Verified Commit 57ca0143 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

Bug 40788: Prevent nsIURLQueryStrippingListService from calling home when it is not enabled.

The URL query stripping service is enabled only in nightly builds,
still it is initialized and remote settings are downloaded.
This adds a condition that prevents the service from being initialized
if disabled.

Upstream Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1812594
We should remove this patch if Mozilla decides that this is a problem
also for them, or if they do not but we decide to use the feature.
parent 9f3496ca
Loading
Loading
Loading
Loading
+17 −5
Original line number Original line Diff line number Diff line
@@ -2649,11 +2649,23 @@ BrowserGlue.prototype = {


      {
      {
        task: () => {
        task: () => {
          // tor-browser#40788: Do not initialize
          // nsIURLQueryStrippingListService to prevent it from initializing
          // its remote settings if it's disabled.
          // See also https://bugzilla.mozilla.org/show_bug.cgi?id=1812594
          let enabledPref = "privacy.query_stripping.enabled";
          let enabledPBMPref = "privacy.query_stripping.enabled.pbmode";

          if (
            Services.prefs.getBoolPref(enabledPref, false) ||
            Services.prefs.getBoolPref(enabledPBMPref, false)
          ) {
            // Init the url query stripping list.
            // Init the url query stripping list.
            let urlQueryStrippingListService = Cc[
            let urlQueryStrippingListService = Cc[
              "@mozilla.org/query-stripping-list-service;1"
              "@mozilla.org/query-stripping-list-service;1"
            ].getService(Ci.nsIURLQueryStrippingListService);
            ].getService(Ci.nsIURLQueryStrippingListService);
            urlQueryStrippingListService.init();
            urlQueryStrippingListService.init();
          }
        },
        },
      },
      },