]> git.ktnx.net Git - icedeb.git/commitdiff
put content JS into a closure
authorDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 12:28:21 +0000 (12:28 +0000)
committerDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 12:28:21 +0000 (12:28 +0000)
icedeb-content.js

index c2a2d36cc42cc70954e6babc4525f75030176acb..30a3cef325be74075c130c99f0f5bd724778a3db 100644 (file)
@@ -1,6 +1,9 @@
-function listener(request, sender, sendResponse) {
-  window.location = request.url;
-  browser.runtime.onMessage.removeListener(listener);
-}
+(function () {
+  var listener;
+  listener = function(request, sender, sendResponse) {
+      browser.runtime.onMessage.removeListener(listener);
+      window.location = request.url;
+    }
 
-browser.runtime.onMessage.addListener(listener);
+    browser.runtime.onMessage.addListener(listener);
+})();