[Pkg-mozext-commits] [greasemonkey] 06/45: Don't overwrite the sandbox console object with the Firebug console.
David Prévot
taffit at moszumanska.debian.org
Mon Nov 3 20:59:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 784a9b81c046eed58b6ee45032f0fb64fc3f18ac
Author: Ventero <ventero at ventero.de>
Date: Fri Sep 5 05:29:13 2014 +0200
Don't overwrite the sandbox console object with the Firebug console.
Recent versions of Firebug attach the console to the content window
as a passive console API listener. Thus, it automatically handles
calls to any console API function, without having to be manually
assigned to the window's console object.
See http://git.io/7DMnWA.
Fixes #1949.
---
components/greasemonkey.js | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/components/greasemonkey.js b/components/greasemonkey.js
index 92cb5a5..a52cd5c 100644
--- a/components/greasemonkey.js
+++ b/components/greasemonkey.js
@@ -57,9 +57,7 @@ function contentLoad(aEvent) {
GM_util.getService().runScripts('document-end', safeWin);
}
-function createSandbox(
- aScript, aContentWin, aChromeWin, aFirebugConsole, aUrl
-) {
+function createSandbox(aScript, aContentWin, aChromeWin, aUrl) {
if (GM_util.inArray(aScript.grants, 'none')) {
// If there is an explicit none grant, use a plain unwrapped sandbox
// with no other content.
@@ -93,7 +91,7 @@ function createSandbox(
'sandboxPrototype': aContentWin,
'wantXrays': true,
});
- if (aFirebugConsole) sandbox.console = aFirebugConsole;
+
// Note that because waivers aren't propagated between origins, we need the
// unsafeWindow getter to live in the sandbox. See http://bugzil.la/1043958
var unsafeWindowGetter = new sandbox.Function(
@@ -159,18 +157,6 @@ function createSandbox(
return sandbox;
}
-function getFirebugConsole(wrappedContentWin, chromeWin) {
- try {
- return chromeWin.Firebug
- && chromeWin.Firebug.getConsoleByGlobal
- && chromeWin.Firebug.getConsoleByGlobal(wrappedContentWin)
- || null;
- } catch (e) {
- dump('Greasemonkey: Failure Firebug console:\n' + uneval(e) + '\n');
- return null;
- }
-}
-
function isTempScript(uri) {
if (uri.scheme != "file") return false;
var file = gFileProtocolHandler.getFileFromURLSpec(uri.spec);
@@ -483,11 +469,9 @@ service.prototype.injectScripts = function(
}
var chromeWin = getChromeWinForContentWin(wrappedContentWin);
- var firebugConsole = getFirebugConsole(wrappedContentWin, chromeWin);
for (var i = 0, script = null; script = scripts[i]; i++) {
- var sandbox = createSandbox(
- script, wrappedContentWin, chromeWin, firebugConsole, url);
+ var sandbox = createSandbox(script, wrappedContentWin, chromeWin, url);
runScriptInSandbox(script, sandbox);
}
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list