From 2af4016523dace1972eed379eec8ea094dd280cf Mon Sep 17 00:00:00 2001 From: tmkk Date: Wed, 10 Apr 2013 02:34:06 +0900 Subject: [PATCH] - fixed a problem that a prototype of sandbox was not set properly on Firefox 22 or later - fixed a problem that scripts are not executed on framed documents --- UserScriptLoader/UserScriptLoader.uc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UserScriptLoader/UserScriptLoader.uc.js b/UserScriptLoader/UserScriptLoader.uc.js index 16a23a6..c070e2c 100644 --- a/UserScriptLoader/UserScriptLoader.uc.js +++ b/UserScriptLoader/UserScriptLoader.uc.js @@ -947,7 +947,7 @@ USL.injectScripts = function(safeWindow, rsflag) { } }); if (documentEnds.length) { - aDocument.addEventListener("DOMContentLoaded", function(event){ + safeWindow.addEventListener("DOMContentLoaded", function(event){ event.currentTarget.removeEventListener(event.type, arguments.callee, false); documentEnds.forEach(function(s) "delay" in s ? safeWindow.setTimeout(run, s.delay, s) : run(s)); @@ -973,7 +973,7 @@ USL.injectScripts = function(safeWindow, rsflag) { return; } - let sandbox = new Cu.Sandbox(safeWindow); + let sandbox = new Cu.Sandbox(safeWindow, {sandboxPrototype: safeWindow}); let GM_API = new USL.API(script, sandbox, safeWindow, aDocument); for (let n in GM_API) sandbox[n] = GM_API[n];