Commit 127d31fe authored by henry's avatar henry
Browse files

fixup! BB 42027: Base Browser migration procedures.

TB 44045: Clear the user values for the now locked ML preferences.
parent 50b3fadd
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -1838,7 +1838,8 @@ BrowserGlue.prototype = {
    //            Also, reset security.xfocsp.errorReporting.automatic since we
    //            hid its neterror checkbox. tor-browser#42653.
    // Version 3: 14.0a7: Reset general.smoothScroll. tor-browser#42070.
    const MIGRATION_VERSION = 3;
    // Version 4: 15.0a2: Drop ML components. tor-browser#44045.
    const MIGRATION_VERSION = 4;
    const MIGRATION_PREF = "basebrowser.migration.version";
    if (this._isNewProfile) {
      // Do not migrate fresh profiles
@@ -1878,6 +1879,28 @@ BrowserGlue.prototype = {
    if (currentVersion < 3) {
      Services.prefs.clearUserPref("general.smoothScroll");
    }
    if (currentVersion < 4) {
      for (const prefName of [
        "browser.translations.enable",
        "browser.ml.enable",
        "browser.ml.chat.enabled",
        "browser.ml.linkPreview.enabled",
        "browser.tabs.groups.smart.enabled",
        "browser.tabs.groups.smart.userEnabled",
        "extensions.ml.enabled",
        "pdfjs.enableAltText",
        "pdfjs.enableAltTextForEnglish",
        "pdfjs.enableGuessAltText",
        "pdfjs.enableAltTextModelDownload",
        "browser.urlbar.quicksuggest.mlEnabled",
        "places.semanticHistory.featureGate",
      ]) {
        // Preferences are locked. Do not want user values to linger in the
        // user's profile and become active if these preferences become unlocked
        // in the future.
        Services.prefs.clearUserPref(prefName);
      }
    }
    Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
  },

+6 −1
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ static const RedirEntry kRedirMap[] = {
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#if defined(NIGHTLY_BUILD)
#if defined(NIGHTLY_BUILD) && !defined(BASE_BROWSER_VERSION)
    // Do not include about:inference since "ml" is excluded. tor-browser#44045.
    {"inference", "chrome://global/content/aboutInference.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
#endif
@@ -208,12 +209,16 @@ static const RedirEntry kRedirMap[] = {
    {"telemetry", "chrome://global/content/aboutTelemetry.xhtml",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
#endif
#ifndef BASE_BROWSER_VERSION
    // Remove about:translations since translations are disabled.
    // See tor-browser#44045 and tor-browser#42872.
    {"translations", "chrome://global/content/translations/translations.html",
     nsIAboutModule::ALLOW_SCRIPT |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#endif
#ifndef BASE_BROWSER_VERSION
    {"url-classifier", "chrome://global/content/aboutUrlClassifier.xhtml",
     nsIAboutModule::ALLOW_SCRIPT},
+4 −3
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ about_pages = [
    'serviceworkers',
    'srcdoc',
    'support',
    'translations',
    # Remove about:translations since translations are disabled.
    # See tor-browser#44045 and tor-browser#42872.
    'telemetry',
    # Removed 'url-classifier'. tor-browser#42831.
]
@@ -51,8 +52,8 @@ if defined('MOZ_TELEMETRY_REPORTING') and not defined('MOZ_GLEAN_ANDROID'):
    about_pages.append('glean')
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'android' and buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'windows':
    about_pages.append('webauthn')
if defined('NIGHTLY_BUILD'):
    about_pages.append('inference')
# Do not include about:inference since "ml" component is missing.
# tor-browser#44045.

Headers = ['/docshell/build/nsDocShellModule.h']