[Pkg-mozext-commits] [automatic-save-folder] 43/133: change : Removed the Firefox closing observer used to set the browser.download.saveLinkAsFilenameTimeout back to 1000, and now set it to userpref.js on ASF installation in order to recover the original state on ASF un-install. If you used beta version up to this revision and un-install ASF, you may have to manually set browser.download.saveLinkAsFilenameTimeout back to 1000 to recover the header reading capability.

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch wip
in repository automatic-save-folder.

commit 5030b501ccbcffa82f023942c610352f1cc68796
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Fri Dec 25 16:17:55 2009 +0000

    change :
    Removed the Firefox closing observer used to set the browser.download.saveLinkAsFilenameTimeout back to 1000, and now set it to userpref.js on ASF installation in order to recover the original state on ASF un-install.
    If you used beta version up to this revision and un-install ASF, you may have to manually set browser.download.saveLinkAsFilenameTimeout back to 1000 to recover the header reading capability.
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@43 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf_right_click.js  | 23 -----------------------
 defaults/preferences/asf.js |  1 +
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/content/asf_right_click.js b/content/asf_right_click.js
index f725bd3..1f50e09 100644
--- a/content/asf_right_click.js
+++ b/content/asf_right_click.js
@@ -75,12 +75,6 @@ var automatic_save_folder = {
 						// Set to 0 only when the user want to use it
 						var asf_rightclick = prefs.getBoolPref("extensions.asf.rightclick");
 						prefs.setIntPref("browser.download.saveLinkAsFilenameTimeout", asf_rightclick == true ? 0 : 1000);
-						
-						// and set it back to 1000 (default) when exiting Firefox
-						// to prevent blocking the user to 0 if add-on is removed without reseting the timeout first.
-						// (From Download sort extension)
-						var obsSvc = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
-						obsSvc.addObserver(this.asf_quitObserver, "quit-application-requested", false);
 					}
 				}
 			}
@@ -89,23 +83,6 @@ var automatic_save_folder = {
 	},
 	
 	
-	// reset Timelimit=0 to =1000 when closing Firefox 
-	// it will reset to 1000 even if closing firefox is canceled.
-	// It will cause ASF right-click to stop working until the user accept any changes in ASF main preferences. 
-	// I think it's very unlikly to happen to a lot of people, and is easily corrected by checking the preferences.
-	asf_quitObserver: {
-		observe: function(subject, topic, state) {
-		
-			//alert(topic);
-			if(topic == "quit-application-requested") {
-				var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-				prefs.setIntPref("browser.download.saveLinkAsFilenameTimeout", 1000);
-			}
-		}
-	},
-	
-	
-	
 	// Original from firefox 3.5.3
 	// I tried to "live-patch" the user function, using 
 	// asf_getTargetFile = ORIG_getTargetFile.toString().replace("first line","first line + ASF")
diff --git a/defaults/preferences/asf.js b/defaults/preferences/asf.js
index 6d4c04a..4a35c45 100644
--- a/defaults/preferences/asf.js
+++ b/defaults/preferences/asf.js
@@ -17,4 +17,5 @@ pref("extensions.asf at mangaheart.org.description", "chrome://asf/locale/asf.prope
  pref("extensions.asf.dialogaccept", false);
  pref("extensions.asf.dialogacceptFiltered", false);
  pref("extensions.asf.rightclick", true);
+ pref("browser.download.saveLinkAsFilenameTimeout", 0); // set the default value to userpref.js to prevent main pref.js modification and restore default value on ASF uninstall.
  pref("extensions.asf.usecurrenturl", false);
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/automatic-save-folder.git



More information about the Pkg-mozext-commits mailing list