[Pkg-mozext-commits] [wot] 04/226: Try search installation only once

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 b46396704df9a60c38722295428602eb15b965b3
Author: Sami Tolvanen <sami at mywot.com>
Date:   Fri Jan 6 19:48:01 2012 +0200

    Try search installation only once
---
 content/config.js   |  2 +-
 content/firstrun.js | 16 ++++++++--------
 content/prefs.js    | 13 ++++---------
 content/util.js     | 16 ++++++++++++++++
 4 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/content/config.js b/content/config.js
index f3bffb1..f602074 100644
--- a/content/config.js
+++ b/content/config.js
@@ -19,7 +19,7 @@
 */
 
 const WOT_PLATFORM = "firefox";
-const WOT_VERSION  = "20120104";
+const WOT_VERSION  = "20120106";
 
 /*
  * Constants
diff --git a/content/firstrun.js b/content/firstrun.js
index c5f63ec..a94146e 100644
--- a/content/firstrun.js
+++ b/content/firstrun.js
@@ -27,14 +27,6 @@ var wot_firstrun =
 				return true;
 			}
 
-			if (!wot_api_register.ready) {
-				window.setTimeout(function() {
-					wot_firstrun.opentab(version, url);
-				}, 500);
-
-				return false;
-			}
-
 			if (!wot_prefs.setChar("firstrun_guide", WOT_FIRSTRUN_CURRENT)) {
 				return false;
 			}
@@ -56,6 +48,14 @@ var wot_firstrun =
 
 	load_delayed: function() {
 		try {
+			if (!wot_api_register.ready) {
+				window.setTimeout(function() {
+					wot_firstrun.load_delayed();
+				}, 500);
+
+				return;
+			}
+
 			var tab = "welcome";
 			var partner = wot_partner.getpartner();
 
diff --git a/content/prefs.js b/content/prefs.js
index 5711897..a17e1e7 100644
--- a/content/prefs.js
+++ b/content/prefs.js
@@ -254,15 +254,6 @@ 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();
 
@@ -270,6 +261,10 @@ var wot_prefs =
 					wot_core.update();
 				}
 
+				if (this.install_search) {
+					wot_browser.installsearch();
+				}
+
 				/* Always use prefetching when blocking is enabled */
 				if (wot_warning.isblocking()) {
 					this.prefetch = true;
diff --git a/content/util.js b/content/util.js
index fe55853..2bf5126 100644
--- a/content/util.js
+++ b/content/util.js
@@ -432,6 +432,22 @@ var wot_browser =
 
 		return false;
 	},
+
+	installsearch: function()
+	{
+		try {
+			wot_prefs.setBool("install_search", false);
+
+			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);
+			}
+		} catch (e) {
+			dump("wot_browser.installsearch: failed with " + e + "\n");
+		}
+	}
 };
 
 /* Provides a simple wrapper for nsICryptoHash */

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