Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make following redirects work for @icon.

Fixes: #1222
  • Loading branch information...
commit 5a75f38b0f594572f8ba8cd7945758a60cd074b4 1 parent 5ec43f0
arantius arantius authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 content/scriptdownloader.js
24 content/scriptdownloader.js
View
@@ -161,11 +161,8 @@ GM_ScriptDownloader.prototype.downloadNextDependency = function(){
var file = GM_getTempFile();
this.tempFiles_.push(file);
- var progressListener = new PersistProgressListener(persist);
- progressListener.onFinish = GM_hitch(this,
- "handleDependencyDownloadComplete", dep, file, sourceChannel);
- persist.progressListener = progressListener;
-
+ persist.progressListener = new PersistProgressListener(
+ dep, file, persist, this);
persist.saveChannel(sourceChannel, file);
} catch(e) {
GM_log("Download exception " + e);
@@ -325,10 +322,11 @@ NotificationCallbacks.prototype.getInterface = function(aIID) {
};
-function PersistProgressListener(persist) {
- this.persist = persist;
- this.onFinish = function(){};
- this.persiststate = "";
+function PersistProgressListener(aDep, aFile, aPersist, aScriptDownload) {
+ this._dep = aDep;
+ this._file = aFile;
+ this._persist = aPersist;
+ this._scriptDownload = aScriptDownload;
}
PersistProgressListener.prototype.QueryInterface = function(aIID) {
@@ -346,10 +344,12 @@ PersistProgressListener.prototype.onSecurityChange = function(){};
PersistProgressListener.prototype.onStateChange =
function(aWebProgress, aRequest, aStateFlags, aStatus) {
- if (this.persist.currentState == this.persist.PERSIST_STATE_FINISHED) {
- GM_log("Persister: Download complete " + aRequest.status);
- this.onFinish();
+ if (this._persist.currentState != this._persist.PERSIST_STATE_FINISHED) {
+ return;
}
+ var channel = aRequest.QueryInterface(Components.interfaces.nsIChannel);
+ this._scriptDownload.handleDependencyDownloadComplete(
+ this._dep, this._file, channel);
};
})();
Please sign in to comment.
Something went wrong with that request. Please try again.