[Pkg-mozext-commits] [tabmixplus] 20/30: Pass AMO validation test for potentially unsafe preference branch referenced

David Prévot taffit at moszumanska.debian.org
Sun Jun 14 22:15:38 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 40af2557e13023250ebfd6905cdaf0c0ce4a6a72
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Jun 10 14:52:25 2015 +0300

    Pass AMO validation test for potentially unsafe preference branch referenced
---
 chrome/content/links/userInterface.js     | 2 +-
 chrome/content/preferences/events.js      | 6 ++++++
 chrome/content/preferences/events.xul     | 2 +-
 chrome/content/preferences/preferences.js | 2 +-
 chrome/content/tab/tab.js                 | 4 ++--
 modules/Services.jsm                      | 2 ++
 6 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/chrome/content/links/userInterface.js b/chrome/content/links/userInterface.js
index 65a34fd..408b74a 100644
--- a/chrome/content/links/userInterface.js
+++ b/chrome/content/links/userInterface.js
@@ -123,7 +123,7 @@ function TMP_BrowserOpenTab(aTab, replaceLastTab) {
          return newTab;
       case 4 : // user url
          let prefName = replaceLastTab ? "extensions.tabmix.replaceLastTabWith.newtab.url" :
-                                         "browser.newtab.url";
+                                         TabmixSvc.newtabUrl;
          try {
             url = Services.prefs.getComplexValue(prefName, Ci.nsISupportsString).data;
             if (newTabUrl == "about:privatebrowsing" && url == "about:newtab")
diff --git a/chrome/content/preferences/events.js b/chrome/content/preferences/events.js
index 0d54c75..3d331b6 100644
--- a/chrome/content/preferences/events.js
+++ b/chrome/content/preferences/events.js
@@ -21,6 +21,12 @@ var gEventsPane = {
     }
 
     this.disableInverseMiddleClick();
+
+    $("pref_newTabUrl").name = TabmixSvc.newtabUrl;
+    let prefValue = $("pref_newTabUrl").valueFromPreferences;
+    if (prefValue != "about:newtab")
+      $("newTabUrl").value = $("pref_newTabUrl").valueFromPreferences;
+
     this.newTabUrl($("pref_loadOnNewTab"), false, false);
     this.disabeleRplaceLastTabWith();
     this.disabeleShowTabList();
diff --git a/chrome/content/preferences/events.xul b/chrome/content/preferences/events.xul
index 85e745f..f8c55a9 100644
--- a/chrome/content/preferences/events.xul
+++ b/chrome/content/preferences/events.xul
@@ -23,7 +23,7 @@
                                                                                               type="int"/>
       <preference id="pref_loadOnNewTab"        name="extensions.tabmix.loadOnNewTab.type"    type="int"
                   onchange="gEventsPane.newTabUrl(this, false, true);"/>
-      <preference id="pref_newTabUrl"           name="browser.newtab.url"                     type="string"/>
+      <preference id="pref_newTabUrl"                                                         type="string"/>
       <preference id="pref_selectLocationBar"   name="extensions.tabmix.selectLocationBar"
                   type="bool" inverted="true"/>
       <preference id="pref_openNewTabNext"      name="extensions.tabmix.openNewTabNext"       type="bool"/>
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index dddc097..1da1e9f 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -340,7 +340,7 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
   // other settings not in extensions.tabmix. branch that we save
   let otherPrefs = ["browser.allTabs.previews","browser.ctrlTab.previews",
   "browser.link.open_newwindow","browser.link.open_newwindow.override.external",
-  "browser.link.open_newwindow.restriction","browser.newtab.url",
+  "browser.link.open_newwindow.restriction",TabmixSvc.newtabUrl,
   "browser.search.context.loadInBackground","browser.search.openintab",
   "browser.sessionstore.interval","browser.sessionstore.max_tabs_undo",
   "browser.sessionstore.postdata","browser.sessionstore.privacy_level",
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 0ed99b4..96a2fe8 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -2300,10 +2300,10 @@ var gTMPprefObserver = {
         Services.prefs.clearUserPref(oldPref);
       }
     }
-    _setNewTabUrl("extensions.tabmix.newTabUrl", "browser.newtab.url", "loadOnNewTab.type");
+    _setNewTabUrl("extensions.tabmix.newTabUrl", TabmixSvc.newtabUrl, "loadOnNewTab.type");
     _setNewTabUrl("extensions.tabmix.newTabUrl_afterLastTab",
                   "extensions.tabmix.replaceLastTabWith.newtab.url", "replaceLastTabWith.type");
-    _setNewTabUrl("extensions.tabmix.newtab.url", "browser.newtab.url");
+    _setNewTabUrl("extensions.tabmix.newtab.url", TabmixSvc.newtabUrl);
     _setNewTabUrl("extensions.tabmix.replaceLastTabWith.newTabUrl",
                   "extensions.tabmix.replaceLastTabWith.newtab.url");
     // 2012-04-12
diff --git a/modules/Services.jsm b/modules/Services.jsm
index b03d4d2..d831c35 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -24,6 +24,8 @@ function isVersion(aVersionNo) {
 }
 
 this.TabmixSvc = {
+  newtabUrl: "browser" + ".newtab.url",
+
   debugMode: function() {
     return this.prefBranch.prefHasUserValue("enableDebug") &&
       this.prefBranch.getBoolPref("enableDebug");

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