Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Push window vars to the window list before scriptDownloader.fetchDependencies is called.
  • Loading branch information
sizzlemctwizzle committed Jul 12, 2010
1 parent 54933c8 commit 3f38945
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions content/script.js
Expand Up @@ -24,7 +24,7 @@ function Script(configNode) {
this._dependFail = false
this.delayInjection = false;
this._rawMeta = null;
this.wins = [];
this.wins = null;

if (configNode) this._loadFromConfigNode(configNode);
}
Expand Down Expand Up @@ -314,16 +314,16 @@ Script.prototype = {
if (!nextFile.equals(this.file)) nextFile.remove(true);
}

// Store window references for late injection
this.wins = [];
this.wins.push({'safeWin': safeWin, 'chromeWin': chromeWin});

// Redownload dependencies.
var scriptDownloader = new GM_ScriptDownloader(null, null, null);
scriptDownloader.script = this;
scriptDownloader.updateScript = true;
scriptDownloader.fetchDependencies();

// Store window references for late injection
this.wins = [];
this.wins.push({'safeWin': safeWin, 'chromeWin': chromeWin});

this.delayInjection = true;
}
},
Expand Down
2 changes: 1 addition & 1 deletion content/scriptdownloader.js
Expand Up @@ -210,7 +210,7 @@ GM_ScriptDownloader.prototype.finishInstall = function() {
for (var i = 0, len = wins.length; i < len; ++i) {
GM_getConfig().injectScript(this.script, wins[i]);
}
this.script.wins = [];
this.script.wins = null;

// Save new values to config.xml
GM_getConfig()._save();
Expand Down

0 comments on commit 3f38945

Please sign in to comment.