[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-68.1.0esr-9.0-1] Bug 31563: force reloading search extensions if extensions.enabledScopes has changed



commit dc1c60e81e6d23560d597c390eed48b2331f005c
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
Date:   Sat Aug 31 16:23:20 2019 +0200

    Bug 31563: force reloading search extensions if extensions.enabledScopes has changed
---
 toolkit/components/search/SearchService.jsm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/toolkit/components/search/SearchService.jsm b/toolkit/components/search/SearchService.jsm
index 419ab822264e..6d6314c6cd4f 100644
--- a/toolkit/components/search/SearchService.jsm
+++ b/toolkit/components/search/SearchService.jsm
@@ -924,6 +924,7 @@ SearchService.prototype = {
     let locale = Services.locale.requestedLocale;
     let buildID = Services.appinfo.platformBuildID;
     let appVersion = Services.appinfo.version;
+    let enabledScopes = Services.prefs.getIntPref("extensions.enabledScopes", -1);
 
     // Allows us to force a cache refresh should the cache format change.
     cache.version = CACHE_VERSION;
@@ -937,6 +938,10 @@ SearchService.prototype = {
     cache.appVersion = appVersion;
     cache.locale = locale;
 
+    // Bug 31563: we want to force reloading engines if extensions.enabledScopes
+    // pref changes
+    cache.enabledScopes = enabledScopes;
+
     cache.visibleDefaultEngines = this._visibleDefaultEngines;
     cache.metaData = this._metaData;
     cache.engines = [];
@@ -1025,7 +1030,8 @@ SearchService.prototype = {
       cache.buildID != buildID ||
       cache.visibleDefaultEngines.length !=
         this._visibleDefaultEngines.length ||
-      this._visibleDefaultEngines.some(notInCacheVisibleEngines);
+      this._visibleDefaultEngines.some(notInCacheVisibleEngines) ||
+      cache.enabledScopes !== Services.prefs.getIntPref("extensions.enabledScopes", -1);
 
     if (!rebuildCache) {
       SearchUtils.log("_loadEngines: loading from cache directories");

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits