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

gk at torproject.org gk at torproject.org
Sat Aug 31 19:26:29 UTC 2019


commit dc1c60e81e6d23560d597c390eed48b2331f005c
Author: Alex Catarineu <acat at torproject.org>
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");



More information about the tor-commits mailing list