[Pkg-mozext-commits] [tabmixplus] 31/107: New options in Options > Links > Open links with target to existing frame in the current tab, default true

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


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit ff04a324aa2c7d6280ac114dfbf5469a36693576
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Oct 25 17:53:59 2015 +0200

    New options in Options > Links > Open links with target to existing frame in the current tab, default true
---
 chrome/content/preferences/links.xul | 7 +++++--
 chrome/locale/en-US/pref-tabmix.dtd  | 1 +
 defaults/preferences/tabmix.js       | 1 +
 modules/ContentClick.jsm             | 8 ++++++--
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/chrome/content/preferences/links.xul b/chrome/content/preferences/links.xul
index 82b6a2c..f7857ba 100644
--- a/chrome/content/preferences/links.xul
+++ b/chrome/content/preferences/links.xul
@@ -21,6 +21,7 @@
       <preference id="pref_divertedWindowOpen"
                   name="browser.link.open_newwindow.restriction"                       type="int"/>
       <preference id="pref_linkTarget"         name="extensions.tabmix.linkTarget"     type="bool"/>
+      <preference id="pref_targetIsFrame"      name="extensions.tabmix.targetIsFrame"  type="bool"/>
       <preference id="pref_filetypeEnable"     name="extensions.tabmix.enablefiletype" type="bool"/>
       <preference id="pref_opentabforLinks"    name="extensions.tabmix.opentabforLinks" type="int"
                   notChecked="0"
@@ -86,8 +87,6 @@
             </hbox>
             <!-- Special control of links -->
             <separator/>
-            <!-- Force link with target attribute to open in current tab -->
-            <checkbox_tmp id="linkTarget" label="&linkTarget.label;" preference="pref_linkTarget" observes="obs_opentabforAllLinks"/>
             <checkbox_tmp id="forceLinkToTab" label="&speLink.label;"
                           preference="pref_opentabforLinks"
                           control="opentabforLinks"
@@ -97,6 +96,10 @@
               <radio value="1" label="&speLink.allLinks;" observes="obs_opentabforLinks"/>
               <radio value="2" label="&speLink.external;" observes="obs_opentabforLinks"/>
             </radiogroup>
+            <!-- Force link with target attribute to open in current tab -->
+            <checkbox_tmp id="linkTarget" label="&linkTarget.label;" preference="pref_linkTarget"
+                          observes="obs_opentabforAllLinks"/>
+            <checkbox_tmp id="targetIsFrame" label="&targetIsFrame.label;" preference="pref_targetIsFrame"/>
             <separator/>
             <!-- Enable Single Window Mode -->
             <checkbox_tmp id="singleWindow" label="&singleWindow.label;" preference="pref_singleWindow"/>
diff --git a/chrome/locale/en-US/pref-tabmix.dtd b/chrome/locale/en-US/pref-tabmix.dtd
index 0227809..d4b3fe2 100644
--- a/chrome/locale/en-US/pref-tabmix.dtd
+++ b/chrome/locale/en-US/pref-tabmix.dtd
@@ -23,6 +23,7 @@
 <!ENTITY divertedWindowOpen.some "Allows resized popups">
 <!ENTITY divertedWindowOpen.none "Allows all popups">
 <!ENTITY linkTarget.label "Open links with a target attribute in current tab">
+<!ENTITY targetIsFrame.label "Open links with target to existing frame in the current tab">
 <!ENTITY download.label "Prevent blank tabs when downloading files">
 <!ENTITY edit.label "Edit">
 <!ENTITY speLink.label "Force to open in new tab:">
diff --git a/defaults/preferences/tabmix.js b/defaults/preferences/tabmix.js
index 8f28ab6..58bdf6d 100644
--- a/defaults/preferences/tabmix.js
+++ b/defaults/preferences/tabmix.js
@@ -2,6 +2,7 @@
 
 pref("extensions.tabmix.disableIncompatible", true);
 pref("extensions.tabmix.linkTarget", false);
+pref("extensions.tabmix.targetIsFrame", true);
 
 pref("extensions.tabmix.opentabforLinks", 0); // 2010-09-16 we replaced speLink
 pref("extensions.tabmix.lockallTabs", false); // added 2010-09-16
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index a49b9c5..7049818 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -418,8 +418,10 @@ var ContentClickInternal = {
      * don't change default behavior for links that point to exiting frame
      * in the current page
      */
-    if (wrappedNode && wrappedNode.targetIsFrame)
+    if (wrappedNode && wrappedNode.targetIsFrame &&
+        TabmixSvc.prefBranch.getBoolPref("targetIsFrame")) {
       return ["default at 13"];
+    }
 
     /*
      * open targeted links in the current tab only if certain conditions are met.
@@ -540,8 +542,10 @@ var ContentClickInternal = {
      * don't change default behavior for links that point to exiting frame
      * in the current page
      */
-    if (wrappedNode && wrappedNode.targetIsFrame)
+    if (wrappedNode && wrappedNode.targetIsFrame &&
+        TabmixSvc.prefBranch.getBoolPref("targetIsFrame")) {
       return "14";
+    }
 
     /*
      * open targeted links in the current tab only if certain conditions are met.

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