aboutsummaryrefslogtreecommitdiff
path: root/js/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/background.js')
-rw-r--r--js/background.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/js/background.js b/js/background.js
index 40998f7..81bf405 100644
--- a/js/background.js
+++ b/js/background.js
@@ -1,6 +1,13 @@
//This is the background script. It is responsible for actually redirecting requests,
//as well as monitoring changes in the redirects and the disabled status and reacting to them.
+function log(msg) {
+ if (log.enabled) {
+ console.log('REDIRECTOR: ' + msg);
+ }
+}
+log.enabled = false;
+
//TODO: Better browser detection...
var isFirefox = false;
@@ -8,6 +15,7 @@ var isFirefox = false;
if (typeof chrome == 'undefined') {
isFirefox = true;
var firefoxShim = require('./firefox/background-shim');
+ firefoxShim.setLogger(log);
chrome = firefoxShim.chrome;
Redirect = firefoxShim.Redirect;
}
@@ -25,13 +33,6 @@ var ignoreNextRequest = {
};
-function log(msg) {
- if (log.enabled) {
- console.log('REDIRECTOR: ' + msg);
- }
-}
-log.enabled = true;
-
function setIcon(image) {
var data = {
path: {