Changeset 859

Show
Ignore:
Timestamp:
2008-03-06 21:48:14 (9 months ago)
Author:
MaierMan
Message:

#523: Download for http password protected site over https fails.
minefield compat

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/chrome/content/dta/manager.js

    r856 r859  
    17221722        this._chan.asyncOpen(this, null); 
    17231723} 
     1724 
     1725var Prompts = { 
     1726        _authPrompter: null, 
     1727        _prompter: null, 
     1728        get authPrompter() { 
     1729                if (!this._authPrompter) { 
     1730                        this._authPrompter = WindowWatcherService.getNewAuthPrompter(window) 
     1731                                .QueryInterface(Ci.nsIAuthPrompt);               
     1732                } 
     1733                return this._authPrompter; 
     1734        }, 
     1735        get prompter() { 
     1736                if (!this._prompter) { 
     1737                        this._prompter = WindowWatcherService.getNewPrompter(window) 
     1738                                .QueryInterface(Ci.nsIPrompt); 
     1739                } 
     1740                return this._prompter; 
     1741        } 
     1742}; 
     1743 
    17241744Connection.prototype = { 
    17251745        _interfaces: [ 
     
    17701790        // nsIInterfaceRequestor 
    17711791        getInterface: function DL_getInterface(iid) { 
    1772                 if (this._interfaces.some(function(i) { return iid.equals(i); })) { 
    1773                         return this; 
    1774                 } 
    17751792                if (iid.equals(Ci.nsIAuthPrompt)) { 
    1776                         return this.authPrompter; 
    1777                 }       
     1793                        return Prompts.authPrompter; 
     1794                } 
    17781795                if (iid.equals(Ci.nsIPrompt)) { 
    1779                         return this.prompter; 
    1780                 } 
    1781                 throw Components.results.NS_ERROR_NO_INTERFACE; 
    1782         }, 
    1783         get authPrompter() { 
    1784                 try { 
    1785                         return WindowWatcherService.getNewAuthPrompter(window) 
    1786                                 .QueryInterface(Ci.nsIAuthPrompt); 
     1796                        return Prompts.prompter; 
     1797                } 
     1798                // for 1.9 
     1799                /* this one makes minefield ask for the password again and again :p 
     1800                if ('nsIAuthPromptProvider' in Ci && iid.equals(Ci.nsIAuthPromptProvider)) { 
     1801                        return Prompts.prompter.QueryInterface(Ci.nsIAuthPromptProvider); 
     1802                }*/ 
     1803                // for 1.9 
     1804                if ('nsIAuthPrompt2' in Ci && iid.equals(Ci.nsIAuthPrompt2)) { 
     1805                        return Prompts.authPrompter.QueryInterface(Ci.nsIAuthPrompt2); 
     1806                } 
     1807                try { 
     1808                        return this.QueryInterface(iid); 
    17871809                } 
    17881810                catch (ex) { 
    1789                         Debug.log("authPrompter", ex); 
    1790                         throw ex; 
    1791                 } 
    1792         }, 
    1793         get prompter() { 
    1794                 try { 
    1795                         return WindowWatcherService.getNewPrompter(window) 
    1796                                 .QueryInterface(Ci.nsIPrompt); 
    1797                 } 
    1798                 catch (ex) { 
    1799                         Debug.log("prompter", ex); 
     1811                        Debug.log("interface not implemented: " + iid, ex); 
    18001812                        throw ex; 
    18011813                }