[Pkg-mozext-commits] [automatic-save-folder] 80/133: Add : - Print filter's and process informations to the error console when downloading a file. (Disabled if Firefox is in PrivateBrowsing mode)

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:54 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 665fde9d9646fa6b4fe636069eba732669b419f4
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Thu Aug 12 16:24:37 2010 +0000

    Add :
    - Print filter's and process informations to the error console when downloading
      a file. (Disabled if Firefox is in PrivateBrowsing mode)
    
    Changes :
    - It's now possible to choose which domain type are used for the filtering
      process, and personalize the order (domain only, full URL, from the file or
      the current tab).
    - Replace old "Use Current Website URL" option to its counterpart value "1,5"
      if the users have that option checked.
    - The dynamic folders, the filter's list on the download window, and the filter
      color highlight match the data according to the new Domain verification process.
    - %asf_f% now uses full filename with extension if no filter match.
    - %asf_d% now uses domain without the protocol if no filter match.
    - Proper checking when reading unknown preferences. (instead of catching the
      error)
    
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@86 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf.js              |  79 ++++++++-----
 content/asf_addedit.js      |   4 +-
 content/asf_download.js     | 194 ++++++++++++++++++++++----------
 content/asf_right_click.js  | 263 +++++++++++++++++++++++++++++++-------------
 content/common.dtd          |   2 +-
 content/options.xul         |  31 ++++--
 defaults/preferences/asf.js |   2 +-
 locale/en-US/about.dtd      |   4 +
 locale/en-US/asf.dtd        |  14 ++-
 locale/fr/about.dtd         |   4 +
 locale/fr/asf.dtd           |  12 +-
 locale/it/about.dtd         |   4 +
 locale/it/asf.dtd           |  12 +-
 locale/ru/about.dtd         |   4 +
 locale/ru/asf.dtd           |  12 +-
 skin/style.css              |   7 ++
 16 files changed, 463 insertions(+), 185 deletions(-)

diff --git a/content/asf.js b/content/asf.js
index 42cc244..e993b49 100644
--- a/content/asf.js
+++ b/content/asf.js
@@ -204,13 +204,16 @@ var automatic_save_folder = {
 		{
 			
 		// Load current file info (source, location and current website URL)
-			var domain = document.getElementById("asf-current-domain").value;
-			var filename = document.getElementById("asf-current-filename").value;
-			var currentURL = document.getElementById("asf-current-url").value;
+			var filename = document.getElementById("asf-currentDL-filename").value;
+			var domain = document.getElementById("asf-currentDL-domain").value;
+			var fileURL = document.getElementById("asf-currentDL-fileURL").value;
+			var fileURLAndFilename = document.getElementById("asf-currentDL-fileURLAndFilename").value;
+			var currentDomain = document.getElementById("asf-currentDL-currentDomain").value;
+			var currentURL = document.getElementById("asf-currentDL-currentURL").value;
+			
 			var treename = "asf-filterList";
 			var tree = document.getElementById(treename);
 			var maxidx = tree.view.rowCount;
-			var use_currentURL = document.getElementById("asf-usecurrenturl").checked;
 			var dom, fil, fol, act, color, dom_regexp, file_regexp ;
 			var found = false;
 			
@@ -227,10 +230,32 @@ var automatic_save_folder = {
 				dom_regexp = false ; // reset the matching string for the "for" loop
 				file_regexp = false ; // same as above
 				
-				dom_regexp = this.test_regexp(dom, domain);  // hosted Domain
-				if (!dom_regexp && use_currentURL)
+				var domain_testOrder = document.getElementById("asf-domainTestOrder").value;
+				if (this.trim(domain_testOrder) == "") domain_testOrder = "1,5";
+				domain_testOrder = domain_testOrder.split(/,/);
+				
+				for ( var j = 0 ; j < domain_testOrder.length ; j++)
 				{
-					dom_regexp = this.test_regexp(dom, currentURL);  // current URL if hosted Domain returns false
+					switch (this.trim(domain_testOrder[j])) 
+					{
+						case "1":
+							dom_regexp = this.test_regexp(dom, domain);
+							break;
+						case "2":
+							dom_regexp = this.test_regexp(dom, fileURL);
+							break;
+						case "3":
+							dom_regexp = this.test_regexp(dom, fileURLAndFilename);
+							break;
+						case "4":
+							dom_regexp = this.test_regexp(dom, currentDomain);
+							break;
+						case "5":
+							dom_regexp = this.test_regexp(dom, currentURL);
+						default:
+					}
+					
+					if (dom_regexp) break;
 				}
 				file_regexp = this.test_regexp(fil, filename); // Filename
 				
@@ -565,26 +590,30 @@ var automatic_save_folder = {
 
 	asf_getdomain: function () {  // Save the domain and filename in a hidden field, to be used by the "add" button for auto-complete field.
 		if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul")  // if the option is opened from the saving window
-		{	
-			var currentdomain = window.opener.document.getElementById("source").value;
-			var currentfilename = window.opener.document.getElementById("location").value ;
+		{
 			var uCT = window.opener.document.getElementById("unknownContentType");
+			var filename = 			window.opener.document.getElementById("location").value ;
+			var domain = 			window.opener.document.getElementById("source").value ;
+			var fileURL = 			window.opener.document.getElementById("source").getAttribute("tooltiptext");
+			var fileURLAndFilename= window.opener.document.getElementById("source").getAttribute("tooltiptext") + filename;
 			try
 			{
-				var currentURL = uCT.parentNode.defaultView.opener.location;
+				var currentDomain, currentURL = "";
+				currentDomain = 	uCT.parentNode.defaultView.opener.location.protocol + "//" + uCT.parentNode.defaultView.opener.location.host; // look for the current website URL in the DOM.
+				currentURL = 		uCT.parentNode.defaultView.opener.location.href; // look for the current website URL in the DOM.
 			}
-			catch(e) // If direct link (copy/past to URLbar, or open from another application), no Tab's URL is returned.
+			catch(e) // if there is no data (The tab is closed or it's a script redirection), use the file's data.
 			{
-				var currentURL = "";
+				currentDomain = domain; 
+				currentURL = fileURL;
 			}
-
-			var domain = document.getElementById("asf-current-domain");
-			var filename = document.getElementById("asf-current-filename");
-			var URL = document.getElementById("asf-current-url");
 			
-			domain.value = currentdomain ;
-			filename.value = currentfilename ;
-			URL.value = currentURL;
+			document.getElementById("asf-currentDL-filename").value = filename;
+			document.getElementById("asf-currentDL-domain").value = domain;
+			document.getElementById("asf-currentDL-fileURL").value = fileURL;
+			document.getElementById("asf-currentDL-fileURLAndFilename").value = fileURLAndFilename;
+			document.getElementById("asf-currentDL-currentDomain").value = currentDomain;
+			document.getElementById("asf-currentDL-currentURL").value = currentURL;
 		}
 	},
 
@@ -985,7 +1014,7 @@ var automatic_save_folder = {
 
 
 	readHiddenPref: function(pref_place, type, ret) {
-		try 
+		if(this.prefManager.getPrefType(pref_place))
 		{
 			switch (type)
 			{
@@ -994,11 +1023,11 @@ var automatic_save_folder = {
 				case "char": return this.prefManager.getCharPref(pref_place);
 				case "complex": return this.prefManager.getComplexValue(pref_place, Components.interfaces.nsISupportsString).data;
 			}
-		} 
-		catch(e) 
+		}
+		else
 		{
 			return ret; // return default value if pref doesn't exist
-		} 
+		}
 	},
 
 
@@ -1079,7 +1108,7 @@ var automatic_save_folder = {
 		if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") // if the option is opened from the saving window
 		{
 			window.opener.automatic_save_folder.main();		// rescan the filters to set the good folder
-			window.opener.check_uCTOption();
+			window.opener.automatic_save_folder.check_uCTOption();
 		}
 		window.opener.focus;
 	}
diff --git a/content/asf_addedit.js b/content/asf_addedit.js
index 75996bf..e759eca 100644
--- a/content/asf_addedit.js
+++ b/content/asf_addedit.js
@@ -26,8 +26,8 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 
 	add_load: function () {
 		
-		var currentdomain = window.opener.document.getElementById("asf-current-domain").value;
-		var currentfilename = window.opener.document.getElementById("asf-current-filename").value ;
+		var currentdomain = window.opener.document.getElementById("asf-currentDL-domain").value;
+		var currentfilename = window.opener.document.getElementById("asf-currentDL-filename").value ;
 		
 		var radio_domain_all = window.document.getElementById("asf-addedit-radio-domain-all");
 		var radio_domain_edited = window.document.getElementById("asf-addedit-radio-domain");
diff --git a/content/asf_download.js b/content/asf_download.js
index 3598708..f0092a4 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -29,6 +29,8 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 				
 		firefoxversion : "",
 		systemslash: "",
+		logtoconsole: true,
+		inPrivateBrowsing: false,
 		
 	main: function () {
 
@@ -39,6 +41,19 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		var appInfo = automatic_save_folder.appInfo;
 		this.checkFirefoxVersion();
 		
+		// Check if the user is in PrivateBrowsing mode.
+		if (this.firefoxversion >= 3)
+		{
+			try
+			{
+				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+									.getService(Components.interfaces.nsIPrivateBrowsingService);
+				this.inPrivateBrowsing = pbs.privateBrowsingEnabled;
+			}
+			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
+			}
+		}
+		
 		// Enable Private Browsing support with filepicker - Thanks to Ehsan Akhgari at http://ehsanakhgari.org/
 		if (this.versionChecker.compare(this.appInfo.version, "3.5") >= 0)
 		{
@@ -50,9 +65,26 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		
 		
 		// load the domain and the filename of the saved file (copy the data from the firefox saving window)
-		var domain = 		document.getElementById("source").value ;
-		var filename = 		document.getElementById("location").value ;
+		var uCT = 				document.getElementById("unknownContentType");
+		var filename = 			document.getElementById("location").value ;
+		var domain = 			document.getElementById("source").value ;
+		var	domainWithoutProtocol = domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
+		var fileURL = 			document.getElementById("source").getAttribute("tooltiptext");
+		var fileURLAndFilename= document.getElementById("source").getAttribute("tooltiptext") + filename;
+		try
+		{
+			var currentDomain, currentURL = "";
+			currentDomain = 	uCT.parentNode.defaultView.opener.location.protocol + "//" + uCT.parentNode.defaultView.opener.location.host; // look for the current website URL in the DOM.
+			currentURL = 		uCT.parentNode.defaultView.opener.location.href; // look for the current website URL in the DOM.
+		}
+		catch (e) // if there is no data (The tab is closed or it's a script redirection), use the file's data.
+		{
+			currentDomain = domain;
+			currentURL = fileURL;
+		}
 		
+		var message = "These data will be used to verify the filters :\nFilename:\t\t"+filename +"\n1 - File's domain:\t"+domain+"\n2 - File's URL:\t\t"+fileURL+"\n3 - Full file's URL:\t"+fileURLAndFilename+"\n4 - Tab's domain:\t"+currentDomain+"\n5 - Tab's URL:\t\t"+currentURL;
+		if (!this.inPrivateBrowsing) this.console_print(message);
 		// debug : show the full downloaded link  http://abc.xyz/def/file.ext
 		// Can use this new function to get free from the need of the download window.
 		//var url = dialog.mLauncher.source.spec;
@@ -70,7 +102,6 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		var variable_mode = 		prefManager.getBoolPref("extensions.asf.variablemode");  // enable Variables in folder creation (dynamic Folders)
 		var dialogaccept = 			prefManager.getBoolPref("extensions.asf.dialogaccept");
 		var dialogacceptFiltered = 	prefManager.getBoolPref("extensions.asf.dialogacceptFiltered");
-		var use_currentURL = 		prefManager.getBoolPref("extensions.asf.usecurrenturl");
 		
 		// If variable/Dynamic folders mode is ON, let's replace the variables to create the new defaultfolder
 		if (variable_mode == true)
@@ -116,18 +147,38 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 				dom_regexp = false ; // reset the matching string for the "for" loop
 				file_regexp = false ; // same as above
 			// Check the domain
-				dom_regexp = this.test_regexp(filters[i][0], domain);  // hosted Domain
+				var domain_testOrder = prefManager.getCharPref("extensions.asf.domainTestOrder");
+				if (this.trim(domain_testOrder) == "") domain_testOrder = "1,5";
+				domain_testOrder = domain_testOrder.split(/,/);
 				
-			// Check the current website URL if hosted domain checking returned false.
-				if (!dom_regexp && use_currentURL)
+				for ( var j = 0 ; j < domain_testOrder.length ; j++)
 				{
-					var uCT = document.getElementById("unknownContentType");
-					try
+					switch (this.trim(domain_testOrder[j])) 
 					{
-						var currentURL = uCT.parentNode.defaultView.opener.location.href; // look for the current website URL in the DOM.
-						dom_regexp = this.test_regexp(filters[i][0], currentURL); // check the filter domain with the current website URL only if the hosted domain doesn't match
+						case "1":
+							dom_regexp = this.test_regexp(filters[i][0], domain);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 1");
+							break;
+						case "2":
+							dom_regexp = this.test_regexp(filters[i][0], fileURL);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 2");
+							break;
+						case "3":
+							dom_regexp = this.test_regexp(filters[i][0], fileURLAndFilename);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 3");
+							break;
+						case "4":
+							dom_regexp = this.test_regexp(filters[i][0], currentDomain);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 4");
+							break;
+						case "5":
+							dom_regexp = this.test_regexp(filters[i][0], currentURL);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 5");
+						default:
+						//alert ("case = "+this.trim(domain_testOrder[j]) );
 					}
-					catch (e) { } // if there is no location.host data (tab is closed or script redirection), use the default folder as there are no filter's domain or current URL domain.
+					
+					if (dom_regexp) break;
 				}
 				
 			// Check the filename
@@ -138,6 +189,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 				if (dom_regexp && file_regexp)
 				{
 					var idx = i;
+					if (this.logtoconsole && !this.inPrivateBrowsing)  this.console_print("Filter "+idx+" is matching both domain and filename.\nDomain:\t\t"+filters[i][0]+"\nFilename:\t"+filters[i][1]+"\nFolder:\t\t"+filters[i][2]);
 					break;
 				}
 			}
@@ -145,6 +197,8 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		
 		if (idx < 0) // if no filters matched
 		{
+			if (this.logtoconsole && !this.inPrivateBrowsing)  this.console_print("No filter matched both domain and filename. These data will be used instead :\nFolder:\t\t"+this.loadUnicodeString("extensions.asf.defaultfolder")+"\n%asf_d%:\t"+domainWithoutProtocol+"\n%asf_f%:\t"+filename);
+			
 			if(savetype == 1)  // and folder is set to user choice
 			{
 				if ( (keeptemp == false) || ((keeptemp == true) && ( tempdomain != domain )) ) // and, if [same domain not checked] OR [ if same domain (keeptemp) is checked and domain not same as previous one]
@@ -201,18 +255,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		}
 		
 		// in every case, set the new file hosted domain to tempdomain if not in private browsing
-		var inPrivateBrowsing = false;
-		if (this.firefoxversion >= 3)
-		{
-			try {
-				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
-									.getService(Components.interfaces.nsIPrivateBrowsingService);
-				inPrivateBrowsing = pbs.privateBrowsingEnabled;
-			}
-			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
-			}
-		}
-		if (!inPrivateBrowsing)
+		if (!this.inPrivateBrowsing)
 		{
 			this.saveUnicodeString("extensions.asf.tempdomain", domain);
 		}
@@ -319,17 +362,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		
 		if (this.firefoxversion >= 3)
 		{
-		
-			var inPrivateBrowsing = false;
-			try {
-				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
-									.getService(Components.interfaces.nsIPrivateBrowsingService);
-				inPrivateBrowsing = pbs.privateBrowsingEnabled;
-			}
-			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
-			}
-			
-			if (inPrivateBrowsing && directory)
+			if (this.inPrivateBrowsing && directory)
 			{
 				gDownloadLastDir.file = directory;
 			}
@@ -412,13 +445,25 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		const ZERO = "0";  // leading zero
 		
 		// load the domain and the filename of the saved file
-		var domain = 	document.getElementById("source").value ;
-			domain =    domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
-		var filename = 	document.getElementById("location").value ;
-		var file_name = filename.replace (/\.(?!.*\.).*$/i, "");  // Trim from the last dot to the end of the file = remove extension
-		var extension = filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
-		
-		
+		var uCT =				document.getElementById("unknownContentType");
+		var filename =			document.getElementById("location").value ;
+		var file_name =			filename.replace (/\.(?!.*\.).*$/i, "");  // Trim from the last dot to the end of the file = remove extension
+		var extension =			filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
+		var domain =			document.getElementById("source").value ;
+		var	domainWithoutProtocol = domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
+		var fileURL =			document.getElementById("source").getAttribute("tooltiptext");
+		var fileURLAndFilename= document.getElementById("source").getAttribute("tooltiptext") + filename;
+		try
+		{
+			var currentDomain, currentURL = "";
+			currentDomain = 	uCT.parentNode.defaultView.opener.location.protocol + "//" + uCT.parentNode.defaultView.opener.location.host; // look for the current website URL in the DOM.
+			currentURL = 		uCT.parentNode.defaultView.opener.location.href; // look for the current website URL in the DOM.
+		}
+		catch (e) // if there is no data (The tab is closed or it's a script redirection), use the file's data.
+		{
+			currentDomain = domain; 
+			currentURL = fileURL;
+		}
 		
 		// check the filter's data
 		var asf_domain = "";
@@ -430,12 +475,44 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		}
 		else // no filter is found, use actual Domain and filename without extension
 		{
-			asf_domain = domain;
-			asf_filename = file_name;
+			asf_domain = domainWithoutProtocol;
+			asf_filename = filename;
 		}
 		
 		
-		var dom_regexp = this.test_regexp(asf_domain, document.getElementById("source").value);
+		// Check the domain
+		var dom_regexp = false;
+		var domain_testOrder = this.prefManager.getCharPref("extensions.asf.domainTestOrder");
+		if (this.trim(domain_testOrder) == "") domain_testOrder = "1,5";
+		domain_testOrder = domain_testOrder.split(/,/);
+		
+		for ( var j = 0 ; j < domain_testOrder.length ; j++)
+		{
+			switch (this.trim(domain_testOrder[j])) 
+			{
+				case "1":
+					dom_regexp = this.test_regexp(asf_domain, domain);
+					break;
+				case "2":
+					dom_regexp = this.test_regexp(asf_domain, fileURL);
+					break;
+				case "3":
+					dom_regexp = this.test_regexp(asf_domain, fileURLAndFilename);
+					break;
+				case "4":
+					dom_regexp = this.test_regexp(asf_domain, currentDomain);
+					break;
+				case "5":
+					dom_regexp = this.test_regexp(asf_domain, currentURL);
+				default:
+				//alert ("case = "+this.trim(domain_testOrder[j]) );
+			}
+			
+			// check the filename
+			if (dom_regexp) break;
+		}
+		
+		// check the filename
 		var file_regexp = this.test_regexp(asf_filename, filename);
 		
 // Ted Gifford, start block
@@ -589,7 +666,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 										.replace(/%d%/g, ((objdate.getDate()) <10) ? (ZERO + (objdate.getDate())) : objdate.getDate())  // = number of the day : 01 to 31
 										.replace(/%j%/g, objdate.getDate())  // = number of the day  1 to 31 (no leading 0)
 										// ASF
-										.replace(/%asf_D%/g, domain)       // downloaded File's domain
+										.replace(/%asf_D%/g, domainWithoutProtocol)       // downloaded File's domain
 										.replace(/%asf_F%/g, filename)     // downloaded File's filename with extension
 										.replace(/%asf_Fx%/g, file_name)   // downloaded File's filename without extension
 										.replace(/%asf_d%/g, asf_domain)   // matching filter's Domain (without special chars used by regexp)
@@ -653,17 +730,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		}
 		if (this.firefoxversion >= 3)
 		{
-		
-			var inPrivateBrowsing = false;
-			try {
-				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
-									.getService(Components.interfaces.nsIPrivateBrowsingService);
-				inPrivateBrowsing = pbs.privateBrowsingEnabled;
-			}
-			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
-			}
-			
-			if (inPrivateBrowsing && gDownloadLastDir.file)
+			if (this.inPrivateBrowsing && gDownloadLastDir.file)
 			{
 				folder = gDownloadLastDir.file.path;
 			}
@@ -1015,7 +1082,7 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 	
 	
 	readHiddenPref: function(pref_place, type, ret) {
-		try 
+		if(this.prefManager.getPrefType(pref_place))
 		{
 			switch (type)
 			{
@@ -1024,11 +1091,11 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 				case "char": return this.prefManager.getCharPref(pref_place);
 				case "complex": return this.prefManager.getComplexValue(pref_place, Components.interfaces.nsISupportsString).data;
 			}
-		} 
-		catch(e) 
+		}
+		else
 		{
 			return ret; // return default value if pref doesn't exist
-		} 
+		}
 	},
 
 
@@ -1225,6 +1292,13 @@ Copyright (C) 2007-2010 Éric Cassar (Cyan).
 		}
 		return string;
 	},
+
+
+	console_print : function (aMessage) {
+		var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
+                                 .getService(Components.interfaces.nsIConsoleService);
+		consoleService.logStringMessage("Automatic Save Folder : \n" + aMessage);
+	},
 };
 
 	addEventListener( // Autoload
diff --git a/content/asf_right_click.js b/content/asf_right_click.js
index bd206d1..9258afa 100644
--- a/content/asf_right_click.js
+++ b/content/asf_right_click.js
@@ -30,11 +30,27 @@ var automatic_save_folder = {
 						.getService(Components.interfaces.nsIVersionComparator),
 				
 	firefoxversion : "",
+	logtoconsole: true,
+	inPrivateBrowsing: false,
+	result: "", // print_r result
 		
 	rightclick_init: function() {
 		if (!asf_rightclick_loaded) 
 		{
 			asf_rightclick_loaded = true;
+			
+			
+			// update changes from asf<=1.0.2r85 to ASF>=1.0.2rev86
+			if(this.prefManager.getPrefType("extensions.asf.usecurrenturl") == 128) // Bool
+			{
+				if (this.prefManager.getBoolPref("extensions.asf.usecurrenturl"))
+				{
+					this.prefManager.setCharPref("extensions.asf.domainTestOrder", "1,5"); // convert usecurrentURL=true to 1,5
+				}
+				this.prefManager.deleteBranch("extensions.asf.usecurrenturl"); // remove old preference
+			}
+			
+			
 			this.checkFirefoxVersion();
 			
 			// Right-click feature doesn't work on Firefox 2 (Can't detect installed add-on and prevent conflict with Download Sort)
@@ -87,25 +103,48 @@ var automatic_save_folder = {
 			// Setting private variables usable in this function
 			var prefManager = this.prefManager;
 			
+			// Check if the user is in PrivateBrowsing mode.
+			try
+			{
+				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+									.getService(Components.interfaces.nsIPrivateBrowsingService);
+				this.inPrivateBrowsing = pbs.privateBrowsingEnabled;
+			}
+			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
+			}
+			
 			// Check if there is any filter in list
 			var nbrfilters = 	prefManager.getIntPref("extensions.asf.filtersNumber");
 				
 				
-			// load the domain and the filename of the saved file (copy the data from the firefox saving window)
-			// var domain = 		document.getElementById("source").value ;
-			// var filename = 		document.getElementById("location").value ;
+			// load the domain and the filename of the saved file
+			var filename = aFpP.fileInfo.fileName; // filename or tab's name if no filename specified.
+			if (typeof(aFpP.fileInfo.uri.fileName) != "undefined") // if the download is from an URL
+			{
+				var domain = 					aFpP.fileInfo.uri.scheme+"://"+aFpP.fileInfo.uri.host;
+				var	domainWithoutProtocol =    	aFpP.fileInfo.uri.host;
+				var fileURL = 					aFpP.fileInfo.uri.prePath+aFpP.fileInfo.uri.directory; 
+				var fileURLAndFilename=			aFpP.fileInfo.uri.prePath+aFpP.fileInfo.uri.path;
+				var currentDomain = document.getElementById("urlbar").value; // look for the current website URL in the DOM.
+					currentDomain = currentDomain.match(/^(.*?:\/\/)?.*?[^\/]+/);
+					currentDomain = currentDomain[0];
+				var currentURL = document.getElementById("urlbar").value;
 			
-			try 
+			}
+			else //  If the saved data is not from an URL (example : Abduction! add-on)
 			{
-				var domain = aFpP.fileInfo.uri.scheme+"://"+aFpP.fileInfo.uri.host ;
+				var domain = document.getElementById("urlbar").value;
+					domain = domain.match(/^(.*?:\/\/)?.*?[^\/]+/);
+					domain = domain[0];
+				var domainWithoutProtocol =  domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
+				var fileURL = "";
+				var fileURLAndFilename = domain+"/"+filename;
+				var currentDomain = domain;
+				var currentURL = document.getElementById("urlbar").value;
 			}
-			catch(e) // If the saved data is not from an URL, use the current website URL (example : Abduction! add-on screenshot function saving the current page into image)
-			{ 
-				var domain = document.getElementById("urlbar").value; 
-				domain = domain.match(/^(.*?:\/\/)?.*?[^\/]+/);
-				domain = domain[0];
-			} 
-			var filename = aFpP.fileInfo.fileName
+			var message = "These data will be used to verify the filters :\nFilename:\t\t"+filename +"\n1 - File's domain:\t"+domain+"\n2 - File's URL:\t\t"+fileURL+"\n3 - Full file's URL:\t"+fileURLAndFilename+"\n4 - Tab's domain:\t"+currentDomain+"\n5 - Tab's URL:\t\t"+currentURL;
+			if (!this.inPrivateBrowsing) this.console_print(message);
+			
 			
 			// For Ctrl+S, if pagename.ext is not on the URL document.title is used as filename, add .htm to the filename
 			var page_title = document.title.replace(" - Mozilla Firefox", "");
@@ -120,7 +159,6 @@ var automatic_save_folder = {
 			var tempdomain = 		this.loadUnicodeString("extensions.asf.tempdomain");
 			var variable_mode = 	prefManager.getBoolPref("extensions.asf.variablemode");
 			var dialogaccept = 		prefManager.getBoolPref("extensions.asf.dialogaccept");
-			var use_currentURL = 	prefManager.getBoolPref("extensions.asf.usecurrenturl");
 			
 			// If variable/Dynamic folders mode is ON, let's check the variables and replace to create the new defaultfolder
 			if (variable_mode == true) 
@@ -150,7 +188,7 @@ var automatic_save_folder = {
 				var fol = this.loadUnicodeString("extensions.asf.filters"+ i +".folder");		
 				var act = prefManager.getBoolPref("extensions.asf.filters"+ i +".active");	
 				filters[i] = [dom, fil, fol, act];
-			}	
+			}
 			
 			
 			// 
@@ -160,26 +198,46 @@ var automatic_save_folder = {
 			var dom_regexp = false;
 			var file_regexp = false;
 			for ( var i = 0 ; i < filters.length ; i++)
-			{		
+			{
 				if (filters[i][3] == true)  // if not temporary deactivated
-				{		
+				{
 					dom_regexp = false ; // reset the matching string for the "for" loop
 					file_regexp = false ; // same as above
 				// Check the domain	
-					dom_regexp = this.test_regexp(filters[i][0], domain);  // hosted Domain
-					
-				// Check the current website URL if hosted domain checking returned false.
-					if (!dom_regexp && use_currentURL)
+				var domain_testOrder = prefManager.getCharPref("extensions.asf.domainTestOrder");
+				if (this.trim(domain_testOrder) == "") domain_testOrder = "1,5";
+				domain_testOrder = domain_testOrder.split(/,/);
+				
+				for ( var j = 0 ; j < domain_testOrder.length ; j++)
+				{
+					switch (this.trim(domain_testOrder[j])) 
 					{
-						
-						try
-						{
-							var currentURL = document.getElementById("urlbar").value;
-							dom_regexp = this.test_regexp(filters[i][0], currentURL); // check the filter domain with the current website URL only if the hosted domain doesn't match
-						}
-						catch (e) { } // if there is no location.host data (tab is closed or script redirection), use the default folder as there are no filter's domain or current URL domain. 
+						case "1":
+							dom_regexp = this.test_regexp(filters[i][0], domain);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 1");
+							break;
+						case "2":
+							dom_regexp = this.test_regexp(filters[i][0], fileURL);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 2");
+							break;
+						case "3":
+							dom_regexp = this.test_regexp(filters[i][0], fileURLAndFilename);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 3");
+							break;
+						case "4":
+							dom_regexp = this.test_regexp(filters[i][0], currentDomain);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 4");
+							break;
+						case "5":
+							dom_regexp = this.test_regexp(filters[i][0], currentURL);
+							if (dom_regexp && this.logtoconsole && !this.inPrivateBrowsing) this.console_print("Filter "+i+" matched domain type : 5");
+						default:
 					}
 					
+					if (dom_regexp) break;
+				}
+				
+				
 				// Check the filename
 					file_regexp = this.test_regexp(filters[i][1], filename); // Filename
 					
@@ -188,6 +246,7 @@ var automatic_save_folder = {
 					if (dom_regexp && file_regexp)
 					{
 						var idx = i;
+						if (this.logtoconsole && !this.inPrivateBrowsing)  this.console_print("Filter "+idx+" is matching both domain and filename.\nDomain:\t\t"+filters[i][0]+"\nFilename:\t"+filters[i][1]+"\nFolder:\t\t"+filters[i][2]);
 						break;
 					}
 				}
@@ -195,6 +254,8 @@ var automatic_save_folder = {
 			
 			if (idx < 0) // if no filters matched
 			{
+				if (this.logtoconsole && !this.inPrivateBrowsing)  this.console_print("No filter matched both domain and filename. These data will be used instead :\nFolder:\t\t"+this.loadUnicodeString("extensions.asf.defaultfolder")+"\n%asf_d%:\t"+domainWithoutProtocol+"\n%asf_f%:\t"+filename);
+				
 				if(savetype == 1)  // and folder is set to user choice
 				{
 					if ( (keeptemp == false) || ((keeptemp == true) && ( tempdomain != domain )) ) // and, if [same domain not checked] OR [ if same domain (keeptemp) is checked and domain not same as previous one]
@@ -251,18 +312,7 @@ var automatic_save_folder = {
 			}
 			
 			// in every case, set the new file hosted domain to tempdomain if not in private browsing
-			var inPrivateBrowsing = false;
-			if (this.firefoxversion >= 3)
-			{
-				try {
-					var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
-										.getService(Components.interfaces.nsIPrivateBrowsingService);
-					inPrivateBrowsing = pbs.privateBrowsingEnabled;
-				}
-				catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
-				}
-			}
-			if (!inPrivateBrowsing)
+			if (!this.inPrivateBrowsing)
 			{
 				this.saveUnicodeString("extensions.asf.tempdomain", domain);
 			}
@@ -298,17 +348,7 @@ var automatic_save_folder = {
 		
 		if (this.firefoxversion >= 3)
 		{
-			
-			var inPrivateBrowsing = false;
-			try {
-				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
-									.getService(Components.interfaces.nsIPrivateBrowsingService);
-				inPrivateBrowsing = pbs.privateBrowsingEnabled;
-			}
-			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
-			}
-			
-			if (inPrivateBrowsing && directory)
+			if (this.inPrivateBrowsing && directory)
 			{
 				if (typeof(gDownloadLastDir) == "undefined") // if not loaded yet
 				{
@@ -385,27 +425,37 @@ var automatic_save_folder = {
 		const ZERO = "0";  // leading zero
 		
 		// load the domain and the filename of the saved file	
-		try
-		{
-			var domain = 	aFpP.fileInfo.uri.host ;
-			var scheme = 	aFpP.fileInfo.uri.scheme ;
-		}
-		catch(e) // If the saved data is not from an URL, use the current website URL (example : Abduction! add-on screenshot function saving the current page into image)
-		{ 
-			var domain = document.getElementById("urlbar").value; 
-			domain = domain.match(/^(.*?:\/\/)?.*?[^\/]+/);
-			var scheme = domain[1];
-			domain = domain[0];
-		} 
-		var filename = 	aFpP.fileInfo.fileName ;
+		var filename = aFpP.fileInfo.fileName; // filename or tab's name if no filename specified.
 		var file_name = aFpP.fileInfo.fileBaseName ;
-		var extension = aFpP.fileInfo.fileExt ;
+		var extension = filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
+		if (typeof(aFpP.fileInfo.uri.fileName) != "undefined") // if the download is from an URL
+		{
+			var domain = 					aFpP.fileInfo.uri.scheme+"://"+aFpP.fileInfo.uri.host;
+			var	domainWithoutProtocol =    	aFpP.fileInfo.uri.host;
+			var fileURL = 					aFpP.fileInfo.uri.prePath+aFpP.fileInfo.uri.directory; 
+			var fileURLAndFilename=			aFpP.fileInfo.uri.prePath+aFpP.fileInfo.uri.path;
+			var currentDomain = document.getElementById("urlbar").value; // look for the current website URL in the DOM.
+				currentDomain = currentDomain.match(/^(.*?:\/\/)?.*?[^\/]+/);
+				currentDomain = currentDomain[0];
+			var currentURL = document.getElementById("urlbar").value;
+		
+		}
+		else //  If the saved data is not from an URL (example : Abduction! add-on), use current URL and tab's name.
+		{
+			var domain = document.getElementById("urlbar").value;
+				domain = domain.match(/^(.*?:\/\/)?.*?[^\/]+/);
+				domain = domain[0];
+			var domainWithoutProtocol =  domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
+			var fileURL = "";
+			var fileURLAndFilename = domain+"/"+filename;
+			var currentDomain = domain;
+			var currentURL = document.getElementById("urlbar").value;
+		}
 		
-		//alert ("domain = "+scheme+"://"+domain);
 		
 		// check the filter's data
 		var asf_domain = "";
-		var asf_filename = "";		
+		var asf_filename = "";
 		if (idx) // If a filter match, idx is true
 		{  
 			asf_domain = this.loadUnicodeString("extensions.asf.filters"+ idx +".domain");
@@ -413,12 +463,41 @@ var automatic_save_folder = {
 		}
 		else // no filter is found, use actual Domain and filename without extension
 		{
-			asf_domain = domain;
-			asf_filename = file_name;
+			asf_domain = domainWithoutProtocol;
+			asf_filename = filename;
 		}
 		
+		// check the domain
+		var dom_regexp = false;
+		var domain_testOrder = this.prefManager.getCharPref("extensions.asf.domainTestOrder");
+		if (this.trim(domain_testOrder) == "") domain_testOrder = "1,5";
+		domain_testOrder = domain_testOrder.split(/,/);
+		
+		for ( var j = 0 ; j < domain_testOrder.length ; j++)
+		{
+			switch (this.trim(domain_testOrder[j])) 
+			{
+				case "1":
+					dom_regexp = this.test_regexp(asf_domain, domain);
+					break;
+				case "2":
+					dom_regexp = this.test_regexp(asf_domain, fileURL);
+					break;
+				case "3":
+					dom_regexp = this.test_regexp(asf_domain, fileURLAndFilename);
+					break;
+				case "4":
+					dom_regexp = this.test_regexp(asf_domain, currentDomain);
+					break;
+				case "5":
+					dom_regexp = this.test_regexp(asf_domain, currentURL);
+				default:
+			}
+			
+			if (dom_regexp) break;
+		}
 		
-		var dom_regexp = this.test_regexp(asf_domain, scheme+"://"+domain); 
+		// Check the filename
 		var file_regexp = this.test_regexp(asf_filename, filename); 
 		
 // Ted Gifford, start block
@@ -467,9 +546,6 @@ var automatic_save_folder = {
 		// Check if asf_rd is present and process     asf_rd = Regexp the domain
 		if (path.search("%asf_rd%") != -1)
 		{
-			// get the domain with the protocol
-			var domainp = 	scheme+"://"+domain ;
-			
 			// extract the filter part
 			var matches = path.match(/%asf_rd%.*?%asf_rd%/g);        // matches is an array
 			if (matches != null)
@@ -482,7 +558,7 @@ var automatic_save_folder = {
 					datareg = matches[i].replace(/%asf_rd%/g, '');  // remove the %asf_rf% to keep only the regexp
 					datareg = new RegExp(datareg, param);			//  create the regexp
 					//alert("reg="+datareg);
-					result = domainp.match(datareg);    // Check it on the domain with protocol
+					result = domain.match(datareg);    // Check it on the domain with protocol
 					
 					if (result == null) 
 					{
@@ -572,7 +648,7 @@ var automatic_save_folder = {
 										.replace(/%d%/g, ((objdate.getDate()) <10) ? (ZERO + (objdate.getDate())) : objdate.getDate())  // = number of the day : 01 to 31
 										.replace(/%j%/g, objdate.getDate())  // = number of the day  1 to 31 (no leading 0)
 										// ASF
-										.replace(/%asf_D%/g, domain)       // downloaded File's domain
+										.replace(/%asf_D%/g, domainWithoutProtocol)       // downloaded File's domain
 										.replace(/%asf_F%/g, filename)     // downloaded File's filename with extension
 										.replace(/%asf_Fx%/g, file_name)   // downloaded File's filename without extension
 										.replace(/%asf_d%/g, asf_domain)   // matching filter's Domain (without special chars used by regexp)
@@ -730,7 +806,7 @@ var automatic_save_folder = {
 	
 	
 	readHiddenPref: function(pref_place, type, ret) {
-		try 
+		if(this.prefManager.getPrefType(pref_place))
 		{
 			switch (type)
 			{
@@ -739,12 +815,41 @@ var automatic_save_folder = {
 				case "char": return this.prefManager.getCharPref(pref_place);
 				case "complex": return this.prefManager.getComplexValue(pref_place, Components.interfaces.nsISupportsString).data;
 			}
-		} 
-		catch(e) 
+		}
+		else
 		{
 			return ret; // return default value if pref doesn't exist
-		} 
-	}
+		}
+	},
+	
+	
+	print_r: function (Obj) {
+		if(Obj.constructor == Array || Obj.constructor == Object)
+		{
+			for(var p in Obj)
+			{
+				if(Obj[p].constructor == Array|| Obj[p].constructor == Object)
+				{
+					this.result = this.result + "<li>["+p+"] =>"+typeof(Obj)+"</li>";
+					this.result = this.result + "<ul>";
+					this.print_r(Obj[p]);
+					this.result = this.result + "</ul>";
+				}
+				else 
+				{
+					this.result = this.result + "<li>["+p+"] =>"+Obj[p]+"</li>";
+				}
+			}
+		}
+		return this.result;
+	},
+	
+	
+	console_print : function (aMessage) {
+		var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
+                                 .getService(Components.interfaces.nsIConsoleService);
+		consoleService.logStringMessage("Automatic Save Folder : \n" + aMessage);
+	},
 }
 	
 	addEventListener( // Autoload
diff --git a/content/common.dtd b/content/common.dtd
index 9c22272..da0f111 100644
--- a/content/common.dtd
+++ b/content/common.dtd
@@ -1,5 +1,5 @@
 <!-- Current version -->
-<!ENTITY asf.version "1.0.2bRev85">
+<!ENTITY asf.version "1.0.2bRev86">
 
 <!ENTITY about.translators "
 - en-US : Cyan, Narayan<br />
diff --git a/content/options.xul b/content/options.xul
index 3c69691..d904d2c 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -42,7 +42,6 @@
 		<preference id="asf_dialogForceRadioTo" name="extensions.asf.dialogForceRadioTo" type="string"/>
 		<preference id="asf_userightclick" name="extensions.asf.userightclick" type="bool"/>
 		<preference id="asf_rightclicktimeout" name="extensions.asf.rightclicktimeout" type="bool"/>
-		<preference id="asf_usecurrenturl" name="extensions.asf.usecurrenturl" type="bool"/>
 		<preference id="asf_domainTestOrder" name="extensions.asf.domainTestOrder" type="string"/>
 		<preference id="asf_useDownloadDir" name="browser.download.useDownloadDir" type="bool"/>
 		<preference id="asf_folderList" name="browser.download.folderList" type="int"/>
@@ -67,6 +66,15 @@
 	<tooltip id="tooltip_rightclicktimeout" label="&asf.rightclicktimeout.tooltip1;
&asf.rightclicktimeout.tooltip2;
&asf.rightclicktimeout.tooltip3;

&asf.rightclicktimeout.tooltip4;" noautohide="true" />
 	<tooltip id="tooltip_variablemode"   label="&asf.variablemode.tooltip1;

&asf.variablemode.tooltip2;" noautohide="true" />
 	<tooltip id="tooltip_dialogacceptFiltered" label="&asf.dialogacceptFiltered.tooltip;" noautohide="true" />
+	<tooltip id="tooltip_domainTestOrder" noautohide="true" align="vertical">
+		<label>&asf.domainTestOrder.tooltip1;</label>
+		<hbox><description value="1 :"/><label>&asf.domainTestOrder.tooltip2;</label></hbox>
+		<hbox><description value="2 :"/><label>&asf.domainTestOrder.tooltip3;</label></hbox>
+		<hbox><description value="3 :"/><label>&asf.domainTestOrder.tooltip4;</label></hbox>
+		<hbox><description value="4 :"/><label>&asf.domainTestOrder.tooltip5;</label></hbox>
+		<hbox><description value="5 :"/><label>&asf.domainTestOrder.tooltip6;</label></hbox>
+		<label>
&asf.domainTestOrder.tooltip7;</label>
+	</tooltip>
 	<vbox>
 		<tabbox>
 			<tabs>
@@ -131,9 +139,12 @@
 			</radiogroup>
 		</groupbox>
 		<groupbox hidden="true">
-			<textbox id="asf-current-domain" value="" />
-			<textbox id="asf-current-filename" value="" />
-			<textbox id="asf-current-url" value="" />
+			<textbox id="asf-currentDL-filename" value="" />
+			<textbox id="asf-currentDL-domain" value="" />
+			<textbox id="asf-currentDL-fileURL" value="" />
+			<textbox id="asf-currentDL-fileURLAndFilename" value="" />
+			<textbox id="asf-currentDL-currentDomain" value="" />
+			<textbox id="asf-currentDL-currentURL" value="" />
 			<textbox id="asf-preferences-window-resize" value="&asf.preferences_window.resize;" />
 			<textbox id="asf-preferences-window-width" value="&asf.preferences_window.width;" />
 			<textbox id="asf-preferences-window-height" value="&asf.preferences_window.height;" />
@@ -143,9 +154,9 @@
 		<separator class="thin"/>
 			<tabbox>
 				<tabs>
-					<tab id="asf-optionssubtab-options" label="&asf.options.tab1.label;"  />
-					<tab id="asf-optionssubtab-options" label="&asf.options.tab2.label;"  />
-					<tab id="asf-optionssubtab-dta" 	label="&asf.options.tabdta.label;" hidden="true" />
+					<tab id="asf-optionssubtab-page1" label="&asf.options.tab1.label;"  />
+					<tab id="asf-optionssubtab-page2" label="&asf.options.tab2.label;"  />
+					<tab id="asf-optionssubtab-dta"   label="&asf.options.tabdta.label;" hidden="true" />
 				</tabs>
 				<tabpanels>
 					<tabpanel flex="1">
@@ -205,7 +216,11 @@
 						<vbox id="asf-options-tab2" flex="1">
 							<groupbox><caption label="&asf.options.groupbox3.label;" />
 								<checkbox id="asf-lasdir" preference="asf_lastdir" label="&asf.lastdir.bool;"/>
-								<checkbox id="asf-usecurrenturl" preference="asf_usecurrenturl" label="&asf.usecurrenturl.bool;"/>
+								<hbox>
+									<label>&asf.domainTestOrder.label1;</label>
+									<textbox id="asf-domainTestOrder" preference="asf_domainTestOrder" size="10"/>
+									<label tooltip="tooltip_domainTestOrder">&asf.domainTestOrder.label2;</label>
+								</hbox>
 								<checkbox id="asf-regexp_caseinsensitive" preference="asf_regexp_caseinsensitive" label="&asf.regexp_caseinsensitive.bool;"/>
 							</groupbox>
 							<groupbox><caption label="&asf.options.groupbox4.label;" />							
diff --git a/defaults/preferences/asf.js b/defaults/preferences/asf.js
index d661618..4be413b 100644
--- a/defaults/preferences/asf.js
+++ b/defaults/preferences/asf.js
@@ -22,7 +22,7 @@ pref("extensions.asf at mangaheart.org.description", "chrome://asf/locale/asf.prope
  pref("extensions.asf.userightclick", true);
  pref("extensions.asf.rightclicktimeout", 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);
+ pref("extensions.asf.domainTestOrder", "1");
  pref("extensions.asf.regexp_caseinsensitive", true);
  pref("extensions.asf.pathlist_defaultforceontop", false);
  pref("extensions.asf.pathlist_alphasort", true);
diff --git a/locale/en-US/about.dtd b/locale/en-US/about.dtd
index 8faa42f..76283ed 100644
--- a/locale/en-US/about.dtd
+++ b/locale/en-US/about.dtd
@@ -28,6 +28,10 @@
 + Added an option to select if the filters are case sensitive or insensitive.
 + New options related to Graphical User Interface.
 + Added a Drag&Drop Copy method (ie. drag+Ctrl on Windows).
++ Print filter's and process informations to the error console when downloading a file. (Disabled if Firefox is in PrivateBrowsing mode)
+* It's now possible to choose which domain type are used for the filtering process, and personalize the verification order (domain only, full URL, from the file or the current tab).
+* %asf_f% now uses full filename with extension if no filter match.
+* %asf_d% now uses domain without the protocol if no filter match.
 ! Fixed a bug where checking the Regexp option when a filter ended by a slash didn't add a second slash.
 ! Fixed a bug where no data were returned if a download was initiated from the URL bar or from an external software which resulted in no filters in the filter's list if the preferences window was opened from the saving dialog "+ Add or edit a filter". (Thanks to MrCOLOMBO)
 ! ASF now uses the full URL instead of the domain when falling back to current website URL if no filter is found, when using single click (Right-click already used full URL).">
diff --git a/locale/en-US/asf.dtd b/locale/en-US/asf.dtd
index 98caae1..72b87dc 100644
--- a/locale/en-US/asf.dtd
+++ b/locale/en-US/asf.dtd
@@ -72,14 +72,22 @@
 <!ENTITY asf.viewpathselect.tooltip "Activate a drop-down menu with all the filter's path.">
 
 <!ENTITY asf.option.groupbox.checkUpdate.label "Beta update">
-<!ENTITY asf.checkBetaUpdate.button "Check if there is a new beta version">
+<!ENTITY asf.checkBetaUpdate.button "Check for Beta Updates...">
 <!ENTITY asf.betaVersionAvailable.label "A new version is available:">
 <!ENTITY asf.betaVersionNotAvailable.label "No new version available.">
 <!ENTITY asf.autoCheckBetaUpdate.bool "Automatically check when opening the preferences window.">
 
 <!ENTITY asf.options.groupbox3.label "Filtering options">
 <!ENTITY asf.lastdir.bool "Affect the folder for the 'save as...' command when a filter matches">
-<!ENTITY asf.usecurrenturl.bool "Use the current website URL to verify the filter's domain if the hosted domain doesn't match.">
+<!ENTITY asf.domainTestOrder.label1 "Choose the domain types to use, and their verification order, when filtering:">
+<!ENTITY asf.domainTestOrder.label2 "[Help]">
+<!ENTITY asf.domainTestOrder.tooltip1 "A coma separated number list to specify in which order the tests on the domain will be performed. Default value if the field is empty: 1,5">
+<!ENTITY asf.domainTestOrder.tooltip2 "File's domain">
+<!ENTITY asf.domainTestOrder.tooltip3 "File's URL">
+<!ENTITY asf.domainTestOrder.tooltip4 "File's URL + Filename">
+<!ENTITY asf.domainTestOrder.tooltip5 "Tab's domain (or the file's domain if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip6 "Tab's URL (or the file's URL if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip7 "For more informations, you can see to which values correspond each entry in the Error console when downloading a file.">
 <!ENTITY asf.regexp_caseinsensitive.bool "Filters are case insensitive.">
 
 <!ENTITY asf.options.groupbox4.label "Right-click">
@@ -93,7 +101,7 @@
 <!ENTITY asf.rightclick.ff2.label "The Automatic Save Folder's right-click feature is not available on Firefox 2. If you want to use the filters on your downloads using the right-click menu "Save link as", you should update your Firefox version to 3.0 minimum (recommended version 3.5 or more).">
 <!ENTITY asf.rightclick.DSort.label "Download sort extension has been detected. &NL;Automatic Save Folder's right-click feature will not work until you disable Download Sort in your Extension manager.">
 
-<!ENTITY asf.options.groupbox5.label "Graphical inerface">
+<!ENTITY asf.options.groupbox5.label "Graphical interface">
 <!ENTITY asf.pathlist_defaultforceontop.bool "On drop-down menus, shows the default save path first.">
 <!ENTITY asf.pathlist_alphasort.bool "Sort save paths list alphabetically.">
 <!ENTITY asf.rowmatchinghighlight.label "Highlight color when selecting a matching filter:">
diff --git a/locale/fr/about.dtd b/locale/fr/about.dtd
index 8b7b851..cd821f6 100644
--- a/locale/fr/about.dtd
+++ b/locale/fr/about.dtd
@@ -28,6 +28,10 @@
 + Ajout d'une option permettant de choisir si les filtres sont sensibles ou insensibles à la casse.
 + Nouvelles options concernant l'interface graphique.
 + Ajout de la fonction Copie lors d'un Drag&Drop (ex. drag+Ctrl sur Windows).
++ Affichage d'informations dans la Console d'erreur concernant les filtres et les fichiers lors d'un téléchargement. (Désactivé lorsque Firefox est en mode Navigation privée)
+* Il est maintenant possible de choisir quel type de domaine sera utilisé pendant le filtrage, et de personaliser leur ordre de vérification (Domaine seul, URL complète, du fichier ou de l'onglet actif).
+* %asf_f% utilise maintenant le nom de fichier complet, avec l'extension, si aucun filtre ne correspond.
+* %asf_d% utilise maintenant le nom de domaine sans le protocol, si aucun filtre ne correspond.
 ! Correction du script permettant de rajouter les slashs aux expressions régulières si le filtre contient déjà un slash à l'une des extrémités.
 ! Correction d'un bug où les données d'un lien direct entré dans la barre d'adresse ou initialisé par un autre programme n'étaient pas lu correctement, empêchant d'afficher la liste des filtres lorsque la fenêtre de préférences était ouverte à partir du lien "+ Ajouter ou éditer un filtre" de la fenêtre d'enregistrement. (Merci à MrCOLOMBO)
 ! ASF utilise maintenant l'URL complète du site courant au lieu de son domaine lorsque qu'aucun filtre n'est trouvé. (Le clic-droit utilisait déjà l'URL complète).">
diff --git a/locale/fr/asf.dtd b/locale/fr/asf.dtd
index 15f8727..2fd4bf7 100644
--- a/locale/fr/asf.dtd
+++ b/locale/fr/asf.dtd
@@ -72,14 +72,22 @@
 <!ENTITY asf.viewpathselect.tooltip "Active le menu déroulant contenant le chemin de chaque filtre.">
 
 <!ENTITY asf.option.groupbox.checkUpdate.label "Mise à jour béta">
-<!ENTITY asf.checkBetaUpdate.button "Vérifier si une nouvelle version béta est disponible">
+<!ENTITY asf.checkBetaUpdate.button "Rechercher des mises à jour béta...">
 <!ENTITY asf.betaVersionAvailable.label "Une nouvelle version est disponible :">
 <!ENTITY asf.betaVersionNotAvailable.label "Pas de nouvelle version disponible.">
 <!ENTITY asf.autoCheckBetaUpdate.bool "Vérifier automatiquement à l'ouverture des préférences.">
 
 <!ENTITY asf.options.groupbox3.label "Pendant le filtrage">
 <!ENTITY asf.lastdir.bool "Modifier aussi le dossier d'enregistrement utilisé par le menu 'Enregistrer sous... (Ctrl+S)'">
-<!ENTITY asf.usecurrenturl.bool "Utiliser l'adresse du site courant pour comparer le domaine du filtre si le domaine d'hébergement ne correspond pas.">
+<!ENTITY asf.domainTestOrder.label1 "Choisissez le type de domaine à utiliser, ainsi que leur ordre de vérification, lors du filtrage :">
+<!ENTITY asf.domainTestOrder.label2 "[Aide]">
+<!ENTITY asf.domainTestOrder.tooltip1 "Spécifiez l'ordre dans lequel les tests sur le domaine seront effectués, en les séparant par une virgule. Valeur par défaut si la case est vide : 1,5">
+<!ENTITY asf.domainTestOrder.tooltip2 "Domaine du fichier">
+<!ENTITY asf.domainTestOrder.tooltip3 "URL du fichier">
+<!ENTITY asf.domainTestOrder.tooltip4 "URL du fichier + nom du fichier">
+<!ENTITY asf.domainTestOrder.tooltip5 "Domaine de l'onglet (ou le domaine du fichier si aucun résultat n'est trouvé)">
+<!ENTITY asf.domainTestOrder.tooltip6 "URL de l'onglet (ou l'URL du fichier si aucun résultat n'est trouvé)">
+<!ENTITY asf.domainTestOrder.tooltip7 "Pour plus de précisions, vous pouvez voir à quoi correspond ces informations dans la Console d'erreurs lorsque vous téléchargez un fichier.">
 <!ENTITY asf.regexp_caseinsensitive.bool "Les filtres sont insensibles à la casse.">
 
 <!ENTITY asf.options.groupbox4.label "Clic droit">
diff --git a/locale/it/about.dtd b/locale/it/about.dtd
index 192d8c0..4beca8f 100644
--- a/locale/it/about.dtd
+++ b/locale/it/about.dtd
@@ -28,6 +28,10 @@
 + Added an option to select if the filters are case sensitive or insensitive.
 + New options related to Graphical User Interface.
 + Added a Drag&Drop Copy method (ie. drag+Ctrl on Windows).
++ Print filter's and process informations to the error console when downloading a file. (Disabled if Firefox is in PrivateBrowsing mode)
+* It's now possible to choose which domain type are used for the filtering process, and personalize the verification order (domain only, full URL, from the file or the current tab).
+* %asf_f% now uses full filename with extension if no filter match.
+* %asf_d% now uses domain without the protocol if no filter match.
 ! Fixed a bug where checking the Regexp option when a filter ended by a slash didn't add a second slash.
 ! Fixed a bug where no data were returned if a download was initiated from the URL bar or from an external software which resulted in no filters in the filter's list if the preferences window was opened from the saving dialog "+ Add or edit a filter". (Thanks to MrCOLOMBO)
 ! ASF now uses the full URL instead of the domain when falling back to current website URL if no filter is found, when using single click (Right-click already used full URL).">
diff --git a/locale/it/asf.dtd b/locale/it/asf.dtd
index 38b4dbd..e7ce1d3 100644
--- a/locale/it/asf.dtd
+++ b/locale/it/asf.dtd
@@ -72,14 +72,22 @@
 <!ENTITY asf.viewpathselect.tooltip "Visualizza un menu con la lista di tutti i percorsi dei filtri.">
 
 <!ENTITY asf.option.groupbox.checkUpdate.label "Beta update">
-<!ENTITY asf.checkBetaUpdate.button "Check if there is a new beta version">
+<!ENTITY asf.checkBetaUpdate.button "Check for Beta Updates...">
 <!ENTITY asf.betaVersionAvailable.label "A new version is available:">
 <!ENTITY asf.betaVersionNotAvailable.label "No new version available.">
 <!ENTITY asf.autoCheckBetaUpdate.bool "Automatically check when opening the preferences window.">
 
 <!ENTITY asf.options.groupbox3.label "Filtering options">
 <!ENTITY asf.lastdir.bool "Ha effetto sulla cartella per il comando 'Salva come...' quando un filtro corrisponde">
-<!ENTITY asf.usecurrenturl.bool "Use the current website URL to verify the filter's domain if the hosted domain doesn't match.">
+<!ENTITY asf.domainTestOrder.label1 "Choose the domain types to use, and their verification order, when filtering:">
+<!ENTITY asf.domainTestOrder.label2 "[Aiuto]">
+<!ENTITY asf.domainTestOrder.tooltip1 "A coma separated number list to specify in which order the tests on the domain will be performed. Default value if the field is empty: 1,5">
+<!ENTITY asf.domainTestOrder.tooltip2 "File's domain">
+<!ENTITY asf.domainTestOrder.tooltip3 "File's URL">
+<!ENTITY asf.domainTestOrder.tooltip4 "File's URL + Filename">
+<!ENTITY asf.domainTestOrder.tooltip5 "Tab's domain (or the file's domain if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip6 "Tab's URL (or the file's URL if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip7 "For more informations, you can see to which values correspond each entry in the Error console when downloading a file.">
 <!ENTITY asf.regexp_caseinsensitive.bool "Filters are case insensitive.">
 
 <!ENTITY asf.options.groupbox4.label "Right-click">
diff --git a/locale/ru/about.dtd b/locale/ru/about.dtd
index a7415f1..ca7e67b 100644
--- a/locale/ru/about.dtd
+++ b/locale/ru/about.dtd
@@ -28,6 +28,10 @@
 + Настройки обработки регистра в фильтрах.
 + Новые опции для графического интерфейса.
 + Добавлен метод копирования через Drag&Drop (Например: Удерживая Ctrl при перетаскивании в Windows).
++ Print filter's and process informations to the error console when downloading a file. (Disabled if Firefox is in PrivateBrowsing mode)
+* It's now possible to choose which domain type are used for the filtering process, and personalize the verification order (domain only, full URL, from the file or the current tab).
+* %asf_f% now uses full filename with extension if no filter match.
+* %asf_d% now uses domain without the protocol if no filter match.
 ! Исправлена обработка регулярных выражений когда фильтр оканчивался на косую черту (слеш).
 ! Исправлена ошибка при открытии окна настроек фильтров из окна сохранения ("+ Добавить или изменить фильтр"), при обработке пути который не был представлен в списке фильтров. (Благодарность MrCOLOMBO)
 ! ASF использует полный путь вместо домена если не найден подходящий фильтр, для левой кнопки мыши (Правая кнопка уже использует полный путь).">
diff --git a/locale/ru/asf.dtd b/locale/ru/asf.dtd
index 95bcc56..a0c485c 100644
--- a/locale/ru/asf.dtd
+++ b/locale/ru/asf.dtd
@@ -72,14 +72,22 @@
 <!ENTITY asf.viewpathselect.tooltip "Активировать меню перетаскивания мышкой для всех папок фильтров.">
 
 <!ENTITY asf.option.groupbox.checkUpdate.label "Beta update">
-<!ENTITY asf.checkBetaUpdate.button "Check if there is a new beta version">
+<!ENTITY asf.checkBetaUpdate.button "Check for Beta Updates...">
 <!ENTITY asf.betaVersionAvailable.label "A new version is available:">
 <!ENTITY asf.betaVersionNotAvailable.label "No new version available.">
 <!ENTITY asf.autoCheckBetaUpdate.bool "Automatically check when opening the preferences window.">
 
 <!ENTITY asf.options.groupbox3.label "Настройки фильтров">
 <!ENTITY asf.lastdir.bool "Изменять папку для команды "сохранить как..." когда есть подходящий фильтр">
-<!ENTITY asf.usecurrenturl.bool "Использовать пусть из строки адреса если не найден фильтр для домена загружаемого файла.">
+<!ENTITY asf.domainTestOrder.label1 "Choose the domain types to use, and their verification order, when filtering:">
+<!ENTITY asf.domainTestOrder.label2 "[Help]">
+<!ENTITY asf.domainTestOrder.tooltip1 "A coma separated number list to specify in which order the tests on the domain will be performed. Default value if the field is empty: 1,5">
+<!ENTITY asf.domainTestOrder.tooltip2 "File's domain">
+<!ENTITY asf.domainTestOrder.tooltip3 "File's URL">
+<!ENTITY asf.domainTestOrder.tooltip4 "File's URL + Filename">
+<!ENTITY asf.domainTestOrder.tooltip5 "Tab's domain (or the file's domain if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip6 "Tab's URL (or the file's URL if no data is found)">
+<!ENTITY asf.domainTestOrder.tooltip7 "For more informations, you can see to which values correspond each entry in the Error console when downloading a file.">
 <!ENTITY asf.regexp_caseinsensitive.bool "Учитывать регистр при обработке фильтров.">
 
 <!ENTITY asf.options.groupbox4.label "Правая кнопка мыши">
diff --git a/skin/style.css b/skin/style.css
index 944820c..d3beec9 100644
--- a/skin/style.css
+++ b/skin/style.css
@@ -12,6 +12,13 @@ toolbar[iconsize="small"] #asf-toolbar-icon-preferences, #asf-menu-preferences
   list-style-image: url("chrome://asf/skin/asf-icon_16x16.png");
 }
 
+  /* options */
+  
+#tooltip_domainTestOrder description {
+  font-weight: bold;
+  margin-bottom: 0px;
+}
+
   /* Filter tree */
 
 treechildren::-moz-tree-checkbox

-- 
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