[Pkg-mozext-commits] [automatic-save-folder] 32/133: Fix : Prevent an exception when the current website URL tab is closed before the save dialog is shown. often happen with redirection download script and Firefox closing the new empty popup window.

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:49 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 82598d353bdcbb738b8a121c8aa25fea0d058d41
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Sat Nov 14 15:28:52 2009 +0000

    Fix : Prevent an exception when the current website URL tab is closed before
          the save dialog is shown.
          often happen with redirection download script and Firefox closing the new
          empty popup window.
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@32 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf_download.js    | 8 ++++++--
 content/asf_right_click.js | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/content/asf_download.js b/content/asf_download.js
index ff13b1b..05ae7c7 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -124,8 +124,12 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 				if (!dom_regexp && use_currentURL)
 				{
 					var uCT = document.getElementById("unknownContentType");
-					var currentURL = uCT.parentNode.defaultView.opener.location.host; // 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
+					try
+					{
+						var currentURL = uCT.parentNode.defaultView.opener.location.host; // 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
+					}
+					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. 
 				}
 				
 			// Check the filename	
diff --git a/content/asf_right_click.js b/content/asf_right_click.js
index e10a51b..65a01fe 100644
--- a/content/asf_right_click.js
+++ b/content/asf_right_click.js
@@ -344,8 +344,12 @@ var automatic_save_folder = {
 				if (!dom_regexp && use_currentURL)
 				{
 					
-					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
+					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. 
 				}
 				
 			// Check the filename	

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