flashgotService.patch
Code: Select all
--- /home/il/Downloads/flashgot/components/flashgotService.js 2010-12-16 16:17:52.000000000 +0300
+++ components/flashgotService.js 2010-12-26 14:21:15.000000000 +0300
@@ -677,10 +677,25 @@
try {
uri = IOS.newURI(l.href, null, null);
if (l.userPass && l.userPass.indexOf(":") > -1) continue;
+ if (uri.scheme == "ftp") {
+ if (uri.username) {
+ var WindowWatcherService = CC["@mozilla.org/embedcomp/window-watcher;1"].getService(CI.nsIWindowWatcher);
+ let _aprompter = WindowWatcherService.getNewAuthPrompter(null).QueryInterface(CI.nsIAuthPrompt);
+ var ftpport = (uri.port < 0 || uri.port == 21 ? "" : ":" + uri.port);
+ var realm = uri.scheme + "://" + uri.username + "@" + uri.host + ftpport;
+
+ if (_aprompter.promptPassword("password", "password for " + realm, realm, _aprompter.SAVE_PASSWORD_NEVER, upwd)) {
+ l.href = uri.scheme + "://" + uri.username + ":" + upwd.value + "@" +
+ uri.host + ftpport + uri.spec.substring(uri.prePath.length);
+ this.log("Authentication data for " + uri + " added.");
+ }
+ }
+ } else {
httpAuthManager.getAuthIdentity(uri.scheme, uri.host, uri.port < 0 ? (uri.scheme == "https" ? 443 : 80) : uri.port, null, null, uri.path, udom, uname, upwd);
this.log("Authentication data for " + uri + " added.");
l.href = uri.scheme + "://" + uname.value + ":" + upwd.value + "@" +
uri.host + (uri.port < 0 ? "" : (":" + uri.port)) + uri.spec.substring(uri.prePath.length);
+ }
} catch(e) {}
}
},
If password is stored, the password prompt won't appear, but will return the password. If not stored, the prompt will appear, you input and press OK,
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101211 Firefox/3.6.13