[Pkg-mozext-commits] [tabmixplus] 01/10: Always check if the link is an xpi link, don't open new tab for left click on xpi links

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:03:19 UTC 2015


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

taffit pushed a commit to tag 0.4.2.1pre.151226a1
in repository tabmixplus.

commit 46e72c8c225dbb07a3624b11ca91a5bae31441ad
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Dec 13 14:17:51 2015 +0200

    Always check if the link is an xpi link, don't open new tab for left click on xpi links
---
 modules/ContentClick.jsm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 45194b8..83c9fa8 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -47,9 +47,7 @@ this.TabmixContentClick = {
   },
 
   isUrlForDownload: function(url) {
-    if (TabmixSvc.prefBranch.getBoolPref("enablefiletype"))
-      return ContentClickInternal.isUrlForDownload(url);
-    return false;
+    return ContentClickInternal.isUrlForDownload(url);
   },
 
   selectExistingTab: function(window, href, targetAttr) {
@@ -700,9 +698,6 @@ var ContentClickInternal = {
         return true;
     }
 
-    if (!TabmixSvc.prefBranch.getBoolPref("enablefiletype"))
-      return false;
-
     if (event.button !== 0 || event.ctrlKey || event.metaKey)
       return false;
 
@@ -732,9 +727,15 @@ var ContentClickInternal = {
     if (linkHref.startsWith("mailto:"))
       return true;
 
-    var filetype = TabmixSvc.prefBranch.getCharPref("filetype");
-    filetype = filetype.toLowerCase();
-    filetype = filetype.split(" ");
+    // always check if the link is an xpi link
+    let filetype = ["xpi"];
+    if (TabmixSvc.prefBranch.getBoolPref("enablefiletype")) {
+      let types = TabmixSvc.prefBranch.getCharPref("filetype");
+      types = types.toLowerCase().split(" ")
+                   .filter(t => filetype.indexOf(t) == -1);
+      filetype = [...filetype, ...types];
+    }
+
     var linkHrefExt = "";
     if (linkHref) {
       linkHref = linkHref.toLowerCase();

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



More information about the Pkg-mozext-commits mailing list