[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 07/483: Make preferences work in SeaMonkey

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:21 UTC 2015


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

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 3c91e421bc524b57a916c29088ee3e0a8bab84ed
Author: Wladimir Palant <trev at gtchat.de>
Date:   Mon Jan 8 12:13:25 2007 +0000

    Make preferences work in SeaMonkey
    
    --HG--
    extra : convert_revision : svn%3Ad8bf93c1-8190-44a8-bb31-1ea94378a4df/trunk%40604
---
 chrome/content/overlay.js | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js
index b3f962c..4a066e2 100644
--- a/chrome/content/overlay.js
+++ b/chrome/content/overlay.js
@@ -33,19 +33,30 @@ function ehhInit() {
   getBrowser().addEventListener("select", ehhStop, false);
 
   // Make sure we configure the shortcut key even if the default pref isn't there
+  var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                              .getService(Components.interfaces.nsIPrefService);
+  var branch = prefService.getBranch("extensions.adblockplus.");
   if (window.abpConfigureKey) {
-    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                                .getService(Components.interfaces.nsIPrefService);
     var defaultBranch = prefService.getDefaultBranch("extensions.adblockplus.");
-    if (!defaultBranch.prefHasUserValue("ehh-selectelement_key")) {
+    try {
+      // Seems to be the only way to test whether the pref really exists in the default branch
+      defaultBranch.getCharPref("ehh-selectelement_key");
+    }
+    catch(e) {
       var key = "Accel Shift H";
       try {
-        key = prefService.getBranch("extensions.adblockplus.")
-                        .getCharPref("ehh-selectelement_key");
-      } catch(e) {}
+        key = branch.getCharPref("ehh-selectelement_key");
+      } catch(e2) {}
       abpConfigureKey("ehh-selectelement", key);
     }
   }
+
+  // Make sure chrome protection works in SeaMonkey
+  if (branch.getPrefType("protectchrome.ehh") != branch.PREF_STRING) {
+    try {
+      key = branch.setCharPref("protectchrome.ehh", "elemhidehelper");
+    } catch(e) {}
+  }
 }
 
 function ehhHideTooltips() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list