Changeset 635

Show
Ignore:
Timestamp:
01/20/08 06:11:55 (11 months ago)
Author:
oyasu..@gmail.com
Message:

Bug fixes to last commit. Observation: all this download error handling code never worked and still does not; it relies on a modal alert, and the install dialog already is modal - so the user has to cancel it to see alerts popping up afterward.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/jhs1/chrome/chromeFiles/content/scriptdownloader.js

    r634 r635  
    9090ScriptDownloader.prototype.fetchDependencies = function(){ 
    9191  GM_log("Fetching Dependencies"); 
    92   var deps = this.script.requires.concat(this.script.resources); 
    93   for (var i = 0; i < deps.length; i++) { 
    94     var dep = deps[i]; 
     92  var dep, deps = this.script.requires.concat(this.script.resources); 
     93  while ((dep = deps.shift())) { 
    9594    if (this.checkDependencyURL(dep.url)) { 
    9695      this.depQueue_.push(dep); 
    9796    } else { 
    98       this.errorInstallDependency(this.script, dep, 
    99         "SecurityException: Request to local and chrome url's is forbidden"); 
     97      var error = new Error("SecurityException: " + 
     98                            "Request to local and chrome urls is forbidden"); 
     99      this.errorInstallDependency(error, dep); 
    100100      return; 
    101101    } 
     
    288288 
    289289    args.unshift(this, onOK, file, channel); 
    290     onOK = GM_hitch.apply(args); 
     290    onOK = GM_hitch.apply(this, args); 
    291291    var progressListener = new PersistProgressListener(onOK); 
    292292    progressListener.persist.saveChannel(channel, file); 
     
    294294    GM_log("Download exception " + e); 
    295295    args.unshift(this, onFail, e); 
    296     onFail = GM_hitch.apply(args); 
     296    onFail = GM_hitch.apply(this, args); 
    297297    onFail(); 
    298298  }