[Pkg-mozext-commits] [wot] 03/226: Install safe search provider if enabled in settings

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:28 UTC 2015


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

taffit pushed a commit to branch master
in repository wot.

commit b7037131b6c2eb5a19f99bc945b534e81cb2e223
Author: Sami Tolvanen <sami at mywot.com>
Date:   Wed Jan 4 14:50:14 2012 +0200

    Install safe search provider if enabled in settings
---
 content/config.js | 7 ++++++-
 content/prefs.js  | 9 +++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/content/config.js b/content/config.js
index 91c5813..f3bffb1 100644
--- a/content/config.js
+++ b/content/config.js
@@ -19,7 +19,7 @@
 */
 
 const WOT_PLATFORM = "firefox";
-const WOT_VERSION  = "20111107";
+const WOT_VERSION  = "20120104";
 
 /*
  * Constants
@@ -54,6 +54,10 @@ const WOT_MIN_COMMENT_DIFF = 35;
 /* Applications */
 const WOT_APPLICATIONS = 6;
 
+/* Search */
+const WOT_SAFESEARCH_NAME = "WOT Safe Search";
+const WOT_SAFESEARCH_URL  = "http://www.mywot.com/files/downloads/wotsafesearch.xml";
+
 /* API */
 const WOT_SERVICE_NORMAL		= "http://api.mywot.com";
 const WOT_SERVICE_SECURE		= "https://api.mywot.com";
@@ -205,6 +209,7 @@ const wot_prefs_bool = [
 	[ "accessible",					false ],
 	[ "create_button",				true  ],
 	[ "enabled",					true  ],
+	[ "install_search",				false ],
 	[ "my_cookies",					true  ],
 	[ "prefetch",					false ],
 	[ "private_disable",			false ],
diff --git a/content/prefs.js b/content/prefs.js
index 3f464f5..5711897 100644
--- a/content/prefs.js
+++ b/content/prefs.js
@@ -254,6 +254,15 @@ var wot_prefs =
 			}
 
 			/* Do stuff */
+			if (this.install_search) {
+				var bss = Components.classes["@mozilla.org/browser/search-service;1"]
+							.getService(Components.interfaces.nsIBrowserSearchService);
+
+				if (!bss.getEngineByName(WOT_SAFESEARCH_NAME)) {
+					bss.addEngine(WOT_SAFESEARCH_URL, 1, null, false);
+				}
+			}
+
 			if (this.updateui) {
 				wot_ui.show_elements();
 

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



More information about the Pkg-mozext-commits mailing list