Skip to content

Commit

Permalink
Use the chrome window we already have a reference to, rather than app…
Browse files Browse the repository at this point in the history
…Svc.hiddenDOMWindow.

Fixes #1354.
  • Loading branch information
arantius committed May 26, 2011
1 parent 694d965 commit 6622f5d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions components/greasemonkey.js
Expand Up @@ -10,16 +10,6 @@ var Cu = Components.utils;

Cu.import("resource://gre/modules/XPCOMUtils.jsm");

// XPCOMUtils.defineLazyServiceGetter() introduced in FF 3.6
if (XPCOMUtils.defineLazyServiceGetter) {
XPCOMUtils.defineLazyServiceGetter(
this, "appSvc", "@mozilla.org/appshell/appShellService;1",
"nsIAppShellService");
} else {
appSvc = Cc["@mozilla.org/appshell/appShellService;1"]
.getService(Ci.nsIAppShellService);
}

var maxJSVersion = (function() {
var appInfo = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
Expand Down Expand Up @@ -462,7 +452,7 @@ service.prototype.injectScripts = function(

storage = new GM_ScriptStorage(script);
xmlhttpRequester = new GM_xmlhttpRequester(
unsafeContentWin, appSvc.hiddenDOMWindow, url);
unsafeContentWin, chromeWin, url);
resources = new GM_Resources(script);

sandbox.unsafeWindow = unsafeContentWin;
Expand Down

0 comments on commit 6622f5d

Please sign in to comment.