diff --git a/patches/gecko-enable-aboutinference.patch b/patches/gecko-enable-aboutinference.patch new file mode 100644 index 00000000..1304321b --- /dev/null +++ b/patches/gecko-enable-aboutinference.patch @@ -0,0 +1,52 @@ +diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp +index df5658c723..0bdad8057e 100644 +--- a/docshell/base/nsAboutRedirector.cpp ++++ b/docshell/base/nsAboutRedirector.cpp +@@ -127,7 +127,7 @@ 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) + {"inference", "chrome://global/content/aboutInference.html", + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}, + #endif +diff --git a/docshell/build/components.conf b/docshell/build/components.conf +index 34e06ce332..e8f5e7b055 100644 +--- a/docshell/build/components.conf ++++ b/docshell/build/components.conf +@@ -50,7 +50,7 @@ if 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'): ++if not defined('NIGHTLY_BUILD'): + about_pages.append('inference') + + Headers = ['/docshell/build/nsDocShellModule.h'] +diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build +index dcf865c539..0de04f224f 100644 +--- a/toolkit/components/moz.build ++++ b/toolkit/components/moz.build +@@ -145,7 +145,7 @@ if CONFIG["MOZ_BACKGROUNDTASKS"]: + if CONFIG["MOZ_UNIFFI_FIXTURES"]: + DIRS += ["uniffi-bindgen-gecko-js/tests"] + +-if CONFIG["NIGHTLY_BUILD"]: ++if not CONFIG["NIGHTLY_BUILD"]: + DIRS += ["aboutinference"] + + UNIFIED_SOURCES += [ +diff --git a/toolkit/locales/jar.mn b/toolkit/locales/jar.mn +index 207e007d2e..72b9c56f72 100644 +--- a/toolkit/locales/jar.mn ++++ b/toolkit/locales/jar.mn +@@ -11,7 +11,7 @@ + #ifdef MOZ_LAYOUT_DEBUGGER + layoutdebug/layoutdebug.ftl (../../layout/tools/layout-debug/ui/content/layoutdebug.ftl) + #endif +-#if defined(NIGHTLY_BUILD) ++#ifndef NIGHTLY_BUILD + preview/aboutInference.ftl (../components/aboutinference/content/aboutInference.ftl) + #endif + diff --git a/patches/preferences/ironfox.js b/patches/preferences/ironfox.js index ef036fa5..1b647fed 100644 --- a/patches/preferences/ironfox.js +++ b/patches/preferences/ironfox.js @@ -47,8 +47,8 @@ pref("signon.rememberSignons", true); // [DEFAULT] pref("webgl.disabled", false); // [DEFAULT] /// Restrict Remote Settings -pref("browser.ironfox.services.settings.allowedCollections", "blocklists/addons,blocklists/addons-bloomfilters,blocklists/gfx,blocklists/plugins,main/addons-manager-settings,main/anti-tracking-url-decoration,main/bounce-tracking-protection-exceptions,main/cookie-banner-rules-list,main/fingerprinting-protection-overrides,main/hijack-blocklists,main/ml-onnx-runtime,main/partitioning-exempt-urls,main/password-recipes,main/query-stripping,main/remote-permissions,main/tracking-protection-lists,main/third-party-cookie-blocking-exempt-urls,main/translations-identification-models,main/translations-models,main/translations-wasm,main/url-classifier-exceptions,main/url-classifier-skip-urls,main/url-parser-default-unknown-schemes-interventions,security-state/cert-revocations,security-state/ct-logs,security-state/intermediates,security-state/onecrl"); -pref("browser.ironfox.services.settings.allowedCollectionsFromDump", "main/ironfox-fingerprinting-protection-overrides,blocklists/addons,blocklists/addons-bloomfilters,blocklists/gfx,main/anti-tracking-url-decoration,main/cookie-banner-rules-list,main/moz-essential-domain-fallbacks,main/password-recipes,main/remote-permissions,main/translations-models,main/translations-wasm,main/url-classifier-skip-urls,main/url-parser-default-unknown-schemes-interventions,security-state/intermediates,security-state/onecrl"); +pref("browser.ironfox.services.settings.allowedCollections", "blocklists/addons,blocklists/addons-bloomfilters,blocklists/gfx,blocklists/plugins,main/addons-manager-settings,main/anti-tracking-url-decoration,main/bounce-tracking-protection-exceptions,main/cookie-banner-rules-list,main/fingerprinting-protection-overrides,main/hijack-blocklists,main/ml-inference-options,main/ml-model-allow-deny-list,main/ml-onnx-runtime,main/partitioning-exempt-urls,main/password-recipes,main/query-stripping,main/remote-permissions,main/tracking-protection-lists,main/third-party-cookie-blocking-exempt-urls,main/translations-identification-models,main/translations-models,main/translations-wasm,main/url-classifier-exceptions,main/url-classifier-skip-urls,main/url-parser-default-unknown-schemes-interventions,security-state/cert-revocations,security-state/ct-logs,security-state/intermediates,security-state/onecrl"); +pref("browser.ironfox.services.settings.allowedCollectionsFromDump", "main/ironfox-fingerprinting-protection-overrides,blocklists/addons,blocklists/addons-bloomfilters,blocklists/gfx,main/anti-tracking-url-decoration,main/cookie-banner-rules-list,main/moz-essential-domain-fallbacks,main/ml-inference-options,main/ml-model-allow-deny-list,main/ml-onnx-runtime,main/password-recipes,main/remote-permissions,main/translations-models,main/translations-wasm,main/url-classifier-skip-urls,main/url-parser-default-unknown-schemes-interventions,security-state/intermediates,security-state/onecrl"); /// Set light/dark mode to match system // We still enable light mode by default, just via a patch for Fenix's UI settings instead diff --git a/scripts/patches.yaml b/scripts/patches.yaml index cc25a024..479dd3a3 100644 --- a/scripts/patches.yaml +++ b/scripts/patches.yaml @@ -525,6 +525,13 @@ patches: effect: "Advanced users can access experimental or hidden features." category: "User Control" + - file: "gecko-enable-aboutinference.patch" + name: "Enable `about:inference`" + description: "Enables the `about:inference` page." + reason: "To allow users to control machine learning models." + effect: "Users can easily test and configure installed machine learning models, as well as other related functionality." + category: "User Interface" + # User Experience - file: "fenix-default-site-permissions.patch" name: "Default Site Permissions"