diff options
author | Ruben Rodriguez <ruben@gnu.org> | 2018-09-13 20:39:48 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@gnu.org> | 2018-09-13 21:02:13 -0400 |
commit | d26b319fd6f98517cc3421f10bf18698b953e4d2 (patch) | |
tree | bc70c4e472a2eaf514d411dba5067d530e5bbea9 /data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js | |
parent | c3b304c51a3386ea09527a479a883253ea35243a (diff) |
Updated extensions list for v60
Diffstat (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js')
-rw-r--r-- | data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js deleted file mode 100644 index f1eec70..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/scriptish/userscript-manager.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var { Services } = require("../chrome/services"); -var obs = require("sdk/deprecated/observer-service"); - -var sandboxFactory = require("./userscript-sandbox"); - -var userscripts = []; - -// TODO: register obs only when there is a userscript -obs.add("content-document-global-created", docReady); -obs.add("chrome-document-global-created", docReady); - -function docReady(safeWin, data) { - let href = (safeWin.location.href - || (safeWin.frameElement && safeWin.frameElement.src)) || ""; - - safeWin.addEventListener("load", function() { - userscripts.forEach(function(script) { - // check that the userscript should be run on this page - if (!script.matchesURL(href)) - return; - - sandboxFactory.evalInSandbox( - script._source, - sandboxFactory.createSandbox(safeWin, script, href), - script.jsversion); - }); - }, true); -} - -exports.register = function(aScript) { - unregister(aScript); - userscripts.push(aScript); -}; - -var unregister = exports.unregister = function unregister(aScript) { - for (var i = userscripts.length - 1; ~i; i--) { - if (userscripts[i] == aScript) { - userscripts.splice(i, 1); - break; - } - } -}; |