Skip to content

Commit

Permalink
Never ever run scripts in a chrome context window.
Browse files Browse the repository at this point in the history
Fixes #1988
  • Loading branch information
arantius committed Aug 22, 2014
1 parent 68dd615 commit 908a666
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/greasemonkey.js
Expand Up @@ -474,6 +474,14 @@ service.prototype.ignoreNextScript = function() {
service.prototype.injectScripts = function(
scripts, url, wrappedContentWin
) {
try {
wrappedContentWin.QueryInterface(Ci.nsIDOMChromeWindow);
// Never ever inject scripts into a chrome context window.
return;
} catch (e) {
// Ignore, it's good if we can't QI to a chrome window.
}

var chromeWin = getChromeWinForContentWin(wrappedContentWin);
var firebugConsole = getFirebugConsole(wrappedContentWin, chromeWin);

Expand Down

0 comments on commit 908a666

Please sign in to comment.