
//

//
// Copyright (C) 2024-2026 celenity
//
// This file is part of Phoenix.
//
// Phoenix is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// Phoenix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Phoenix. If not, see https://www.gnu.org/licenses/.
//

// This file contains preferences shared across Phoenix 'Extended' configs.

/* INDEX 

001: FINGERPRINTING PROTECTION
002: WEBRTC
003: ATTACK SURFACE REDUCTION
004: MISC. PRIVACY + SECURITY (ANDROID ONLY)
005: MISC. PRIVACY

*/

/* KEY

Unspecified = This preference should be set EVERYWHERE

[ANDROID-ONLY] = This preference should ONLY be set for Android
[FLATPAK-LINUX-ONLY] = This preference should ONLY be set for GNU/Linux (Flatpak)
[LINUX-ONLY] = This preference should ONLY be set for GNU/Linux
[INTEL-OSX-ONLY] = This preference should ONLY be set for macOS on Intel
[LINUX-NON-FLATPAK-ONLY] = This preference should ONLY be set for GNU/Linux (non-Flatpak)
[OSX-ONLY] = This preference should ONLY be set for macOS
[SILICON-OSX-ONLY] = This preference should ONLY be set for macOS on Apple Silicon
[WINDOWS-ONLY] = This preference should ONLY be set for Windows

[NO-ANDROID] = This preference should be set everywhere, EXCEPT for Android
[NO-FLATPAK-LINUX] = This preference should be set everywhere, EXCEPT for GNU/Linux (Flatpak)
[NO-LINUX] = This preference should be set everywhere, EXCEPT for GNU/Linux
[NO-NON-FLATPAK-LINUX] = This preference should be set everywhere, EXCEPT for GNU/Linux (non-Flatpak)
[NO-MAIL] = This preference should be set everywhere, EXCEPT for Thunderbird (Useful for ex. Dove)
[NO-OSX] = This preference should be set everywhere, EXCEPT for macOS
[NO-INTEL-OSX] = This preference should be set everywhere, EXCEPT for macOS on Intel
[NO-SILICON-OSX] = This preference should be set everywhere, EXCEPT for macOS on Apple Silicon
[NO-WINDOWS] = This preference should be set everywhere, EXCEPT for Windows

*/

/// Add custom branding at `about:support`
defaultPref("app.support.vendor", "Phoenix - Extended: {PHOENIX_VERSION}"); // [NO-MAIL] [HIDDEN]

/// Add custom branding under `Firefox Updates` at `about:preferences#general` [NO-ANDROID]
// This will unfortunately only display if the version of Firefox you're using is repackaged (ex. Flatpaks/Linux distros) [NO-ANDROID]
lockPref("distribution.about", "Phoenix - Extended for Mozilla Firefox: {PHOENIX_VERSION} 💜"); // [NO-ANDROID] [NO-MAIL] [HIDDEN]

/*** 001 FINGERPRINTING PROTECTION ***/

/// Enable dynamic rounding of content dimensions [NO-ANDROID]
// https://bugzilla.mozilla.org/show_bug.cgi?id=1407366 [NO-ANDROID]
defaultPref("privacy.resistFingerprinting.letterboxing", true); // [NO-ANDROID]

/// Further harden FPP...
// As explained here: https://codeberg.org/celenity/Phoenix/wiki/Extended#fingerprinting
// Compared to standard, this just removes '-JSDateTimeUTC' - meaning timezone is spoofed to UTC-0
defaultPref("privacy.fingerprintingProtection.overrides", "+AllTargets,-CanvasExtractionBeforeUserInputIsBlocked,-CSSPrefersColorScheme,-EfficientCanvasRandomization,-FrameRate"); // [NO-ANDROID] [NO-MAIL]
defaultPref("privacy.fingerprintingProtection.overrides", "+AllTargets,-CanvasExtractionBeforeUserInputIsBlocked,-CSSPrefersColorScheme,-EfficientCanvasRandomization,-FrameRate,-CanvasImageExtractionPrompt"); // [ANDROID-ONLY]
defaultPref("browser.phoenix.status.extended", "001");

/*** 002 WEBRTC ***/
// This will likely break WebRTC...

/// Always exclude local IP addresses, even in trusted scenarios
defaultPref("media.peerconnection.ice.no_host", true);

/// Force a single candidate for ICE generation
defaultPref("media.peerconnection.ice.default_address_only", true);

/// Only use TURN servers/relays
// No P2P
// https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/issues/40#note_2884663
defaultPref("media.peerconnection.ice.relay_only", true);

defaultPref("browser.phoenix.status.extended", "002");

/*** 003 ATTACK SURFACE REDUCTION ***/

/// Disable WebAssembly (WASM)
// https://spectrum.ieee.org/more-worries-over-the-security-of-web-assembly
defaultPref("javascript.options.wasm", false);

defaultPref("browser.phoenix.status.extended", "003");

/*** 004 MISC. PRIVACY + SECURITY ***/

/// Disable WebGL [ANDROID-ONLY]
// PRIVACY: Fingerprinting concerns [ANDROID-ONLY]
// SECURITY: Attack Surface Reduction [ANDROID-ONLY]
// https://blog.browserscan.net/docs/webgl-fingerprinting [ANDROID-ONLY]
// https://security.stackexchange.com/questions/13799/is-webgl-a-security-concern [ANDROID-ONLY]
// On desktop we're no longer setting/recommending this in favor of the built-in `Block WebGL` filterlist in uBlock Origin, but on Android, we can't necessarily control uBlock Origin/set policies, so let's just make sure this is disabled. [ANDROID-ONLY]
defaultPref("webgl.disabled", true); // [ANDROID-ONLY]

defaultPref("browser.phoenix.status.extended", "004");

/*** 005 MISC. PRIVACY ***/

/// Only send cross-origin referers if hosts match
// https://wiki.mozilla.org/Security/Referrer
defaultPref("network.http.referer.XOriginPolicy", 2);

defaultPref("browser.phoenix.status.extended", "005");

lockPref("browser.phoenix.status.extended", "successfully applied :D");
//

//
// Copyright (C) 2024-2026 celenity
//
// This file is part of Phoenix.
//
// Phoenix is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// Phoenix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Phoenix. If not, see https://www.gnu.org/licenses/.
//

// This is for shared preferences across Phoenix's 'specialized' configs...

// Do not apply these settings on profiles you actually plan to browse on or actively use...

// Goal here is to make these profile as light-weight & minimal as possible.

/* INDEX 

001: UI
002: DEBLOAT
003: PRIVACY + SECURITY
004: PRIVACY
005: SECURITY
006: MISC.

*/

/*** 001 UI ***/

/// Disable bookmark edit dialog
defaultPref("browser.bookmarks.editDialog.maxRecentFolders", 0); // Don't try to display any recently selected folders in it either...
defaultPref("browser.bookmarks.editDialog.showForNewBookmarks", false);

/// Disable the bookmarks toolbar
clearPref("browser.toolbars.bookmarks.visibility"); // Temporary, to ensure our new setting below takes effect, due to how we previously handled this via policies
defaultPref("browser.bookmarks.defaultLocation", "menu");
defaultPref("browser.toolbars.bookmarks.visibility", "never");

/// Disable button to switch search engines
defaultPref("browser.urlbar.searchModeSwitcher.featureGate", false); // [HIDDEN]

/// Disable the "Close duplicate tabs" context menu item
defaultPref("browser.tabs.context.close-duplicate.enabled", false);

/// Disable the download panel first-use pop-up
defaultPref("browser.download.panel.shown", true);

/// Disable the fire button in Private Browsing Windows
defaultPref("browser.privatebrowsing.resetPBM.enabled", false);

/// Disable the "Forget" button
defaultPref("privacy.panicButton.enabled", false);

/// Disable history swipe animations
defaultPref("browser.history_swipe_animation.disabled", true);

/// Disable local keyword shortcuts
defaultPref("browser.urlbar.searchRestrictKeywords.featureGate", false); // [HIDDEN]

/// Disable the menu bar
// Using `ui.nativeMenubar` here is clever, it tricks the browser into thinking we're using ex. OS X - where the built-in menu bar isn't supported (since OS X handles it natively)
// So, on environments outside of OS X, this effectively disables the menu bar
defaultPref("ui.key.menuAccessKeyFocuses", false); // [DEFAULT - non-Windows/Linux] Ensure the alt key doesn't toggle the menu bar
defaultPref("ui.nativeMenubar", 1); // [HIDDEN] 
defaultPref("widget.gtk.global-menu.enabled", false); // [DEFAULT] Linux (GTK)
defaultPref("widget.gtk.global-menu.wayland.enabled", false); // [DEFAULT] Linux (GTK)

/// Disable the new Sidebar
// Note: This is technically required for vertical tabs (which we enable below), so we partially enable it - but we hide it/remove it from visibility
lockPref("browser.toolbarbuttons.introduced.sidebar-button", true); // Ensure the sidebar icon isn't pinned to the URL bar on first run
defaultPref("sidebar.expandOnHover", false);
defaultPref("sidebar.main.tools", "");
lockPref("sidebar.revamp", true);

/// Disable the new URL bar/search UI by default
defaultPref("browser.urlbar.scotchBonnet.enableOverride", false);

/// Disable notification if default search engine is removed
defaultPref("browser.search.removeEngineInfobar.enabled", false);

/// Disable profiles UI
defaultPref("browser.profiles.enabled", false);

/// Disable the "Saved to bookmarks" confirmation hint
// https://searchfox.org/firefox-main/rev/4dad4a9a/browser/base/content/browser-places.js#357
defaultPref("browser.bookmarks.editDialog.confirmationHintShowCount", 3); // [HIDDEN]

/// Disable the "Share URL" menu item
defaultPref("browser.menu.share_url.allow", false); // [HIDDEN]

/// Disable tab detach
defaultPref("browser.tabs.allowTabDetach", false);

/// Disable Tab Groups
// https://www.ghacks.net/2024/12/03/how-to-enable-tab-groups-in-firefox/
defaultPref("browser.tabs.groups.enabled", false);

/// Disable tab notes
// https://searchfox.org/firefox-main/rev/ac83682a/browser/components/tabbrowser/content/tabbrowser.js#9694
defaultPref("browser.tabs.notes.enabled", false); // [DEFAULT - non-Nightly]

/// Disable tab "split view"
defaultPref("browser.tabs.splitView.enabled", false); // [DEFAULT]

/// Disable tooltips
defaultPref("browser.chrome.toolbar_tips", false);

/// Disable UI for using a different search engine in normal vs. private Windows
defaultPref("browser.search.separatePrivateDefault.ui.enabled", false);

/// Disable the "Unload Tab" context menu item
defaultPref("browser.tabs.unloadTabInContextMenu", false);

/// Disable URL Bar suggestions
defaultPref("browser.search.separatePrivateDefault.urlbarResult.enabled", false); // [DEFAULT]
defaultPref("browser.translations.quickAction.enabled", false); // [NIGHTLY]
defaultPref("browser.urlbar.accessibility.tabToSearch.announceResults", false);
defaultPref("browser.urlbar.addons.featureGate", false);
defaultPref("browser.urlbar.allowSearchSuggestionsForSimpleOrigins", false);
defaultPref("browser.urlbar.clipboard.featureGate", false);
defaultPref("browser.urlbar.closeOtherPanelsOnOpen", false); // [HIDDEN]
defaultPref("browser.urlbar.contextualSearch.enabled", false);
defaultPref("browser.urlbar.experimental.hideHeuristic", true); // [HIDDEN]
defaultPref("browser.urlbar.flightStatus.featureGate", false);
defaultPref("browser.urlbar.importantDates.featureGate", false);
defaultPref("browser.urlbar.market.featureGate", false);
defaultPref("browser.urlbar.maxHistoricalSearchSuggestions", 0);
defaultPref("browser.urlbar.maxRichResults", 0);
defaultPref("browser.urlbar.mdn.featureGate", false);
defaultPref("browser.urlbar.merino.endpointURL", "");
defaultPref("browser.urlbar.merino.ohttpConfigURL", "");
defaultPref("browser.urlbar.merino.ohttpRelayURL", "");
defaultPref("browser.urlbar.merino.providers", "");
defaultPref("browser.urlbar.quickactions.enabled", false); // [HIDDEN]
defaultPref("browser.urlbar.quickactions.showPrefs", false); // [HIDDEN] [DEFAULT]
defaultPref("browser.urlbar.recentsearches.featureGate", false);
defaultPref("browser.urlbar.resultMenu.keyboardAccessible", false);
defaultPref("browser.urlbar.richSuggestions.featureGate", false);
defaultPref("browser.urlbar.richSuggestions.tail", false);
defaultPref("browser.urlbar.rustIngestIntervalSeconds", -1); // [HIDDEN]
defaultPref("browser.urlbar.secondaryActions.featureGate", false); // [HIDDEN]
defaultPref("browser.urlbar.sports.featureGate", false); // [NIGHTLY]
defaultPref("browser.urlbar.suggest.bookmark", false);
defaultPref("browser.urlbar.suggest.calculator", false);
defaultPref("browser.urlbar.suggest.importantDates", false);
defaultPref("browser.urlbar.suggest.openpage", false);
defaultPref("browser.urlbar.suggest.remotetab", false);
defaultPref("browser.urlbar.suggest.sports", false); // [NIGHTLY]
defaultPref("browser.urlbar.suggest.topsites", false);
defaultPref("browser.urlbar.trending.featureGate", false);
defaultPref("browser.urlbar.unitConversion.enabled", false);
defaultPref("browser.urlbar.weather.featureGate", false); // [DEFAULT]
defaultPref("browser.urlbar.wikipedia.featureGate", false); // [DEFAULT]
defaultPref("keyword.enabled", false);

/// Disable visual search
defaultPref("browser.search.visualSearch.featureGate", false);

/// Do not automatically add UI widgets
defaultPref("browser.uiCustomization.autoAdd", false); // [HIDDEN]

/// Do not display separate tabs
defaultPref("browser.tabs.tabMinWidth", 2000);

/// Enable `Compact` mode
defaultPref("browser.uidensity", 1);

/// Enable the use of cursor (arrow) keys to navigate webpages
defaultPref("accessibility.browsewithcaret", true);

/// Enable vertical tabs
lockPref("sidebar.verticalTabs", true); // [DEFAULT]

/// Ensure we do not try to display PID and activeness when hovering over tabs
defaultPref("browser.tabs.tooltipsShowPidAndActiveness", false); // [DEFAULT - non-Nightly]

/// Hide "Mobile Bookmarks"
defaultPref("browser.toolbars.bookmarks.showMobileBookmarks", false); // [HIDDEN]

/// Hide "Other Bookmarks"
defaultPref("browser.toolbars.bookmarks.showOtherBookmarks", false);

/// Hide the search bar at `Customize toolbar...`
defaultPref("browser.search.widget.inNavBar", false); // [HIDDEN] [DEFAULT]
defaultPref("browser.search.widget.new", false); // [DEFAULT]

/// Hide tab "x" button
defaultPref("browser.tabs.tabClipWidth", 999999999);

/// Hide UI elements
defaultPref("browser.uiCustomization.horizontalTabsBackup", '{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":[],"nav-bar":["vertical-spacer","screenshot-button","back-button","forward-button","customizableui-special-spring232","customizableui-special-spring233","customizableui-special-spring237","customizableui-special-spring238","customizableui-special-spring241","customizableui-special-spring243","customizableui-special-spring244","customizableui-special-spring247","customizableui-special-spring249","customizableui-special-spring253","customizableui-special-spring256","customizableui-special-spring259","customizableui-special-spring262","customizableui-special-spring265","customizableui-special-spring268","customizableui-special-spring271","customizableui-special-spring274","customizableui-special-spring278","customizableui-special-spring281","customizableui-special-spring284","customizableui-special-spring287","customizableui-special-spring290","customizableui-special-spring293","customizableui-special-spring296","customizableui-special-spring303","customizableui-special-spring304","customizableui-special-spring308","customizableui-special-spring310","customizableui-special-spring313","customizableui-special-spring315","customizableui-special-spring318","customizableui-special-spring322","customizableui-special-spring324","customizableui-special-spring327","stop-reload-button","urlbar-container","home-button","customizableui-special-spring339","customizableui-special-spring326","customizableui-special-spring323","customizableui-special-spring321","customizableui-special-spring317","customizableui-special-spring314","customizableui-special-spring312","customizableui-special-spring309","customizableui-special-spring307","customizableui-special-spring305","customizableui-special-spring302","customizableui-special-spring295","customizableui-special-spring292","customizableui-special-spring289","customizableui-special-spring286","customizableui-special-spring283","customizableui-special-spring280","customizableui-special-spring277","customizableui-special-spring273","customizableui-special-spring270","customizableui-special-spring267","customizableui-special-spring264","customizableui-special-spring261","customizableui-special-spring258","customizableui-special-spring255","customizableui-special-spring252","customizableui-special-spring250","customizableui-special-spring246","customizableui-special-spring245","customizableui-special-spring242","customizableui-special-spring240","customizableui-special-spring239","customizableui-special-spring236","downloads-button","ublock0_raymondhill_net-browser-action","unified-extensions-button","fullscreen-button"],"TabsToolbar":[],"vertical-tabs":["tabbrowser-tabs"],"PersonalToolbar":["personal-bookmarks"],"toolbar-menubar":["menubar-items"]},"seen":[],"dirtyAreaCache":["nav-bar","vertical-tabs","PersonalToolbar","unified-extensions-area","TabsToolbar","toolbar-menubar"],"currentVersion":23,"newElementCount":339}');
defaultPref("browser.uiCustomization.horizontalTabstrip", '["tabbrowser-tabs"]');
defaultPref("browser.uiCustomization.navBarWhenVerticalTabs", '["vertical-spacer","screenshot-button","stop-reload-button","back-button","customizableui-special-spring232","customizableui-special-spring233","customizableui-special-spring237","customizableui-special-spring238","customizableui-special-spring241","customizableui-special-spring243","customizableui-special-spring244","customizableui-special-spring247","customizableui-special-spring249","customizableui-special-spring253","customizableui-special-spring256","customizableui-special-spring259","customizableui-special-spring262","customizableui-special-spring265","customizableui-special-spring268","customizableui-special-spring271","customizableui-special-spring274","customizableui-special-spring278","customizableui-special-spring281","customizableui-special-spring284","customizableui-special-spring287","customizableui-special-spring290","customizableui-special-spring293","customizableui-special-spring296","customizableui-special-spring303","customizableui-special-spring304","customizableui-special-spring308","customizableui-special-spring310","customizableui-special-spring313","customizableui-special-spring315","customizableui-special-spring318","customizableui-special-spring322","customizableui-special-spring324","customizableui-special-spring327","urlbar-container","customizableui-special-spring326","customizableui-special-spring323","customizableui-special-spring321","customizableui-special-spring317","customizableui-special-spring314","customizableui-special-spring312","customizableui-special-spring309","customizableui-special-spring307","customizableui-special-spring305","customizableui-special-spring302","customizableui-special-spring295","customizableui-special-spring292","customizableui-special-spring289","customizableui-special-spring286","customizableui-special-spring283","customizableui-special-spring280","customizableui-special-spring277","customizableui-special-spring273","customizableui-special-spring270","customizableui-special-spring267","customizableui-special-spring264","customizableui-special-spring261","customizableui-special-spring258","customizableui-special-spring255","customizableui-special-spring252","customizableui-special-spring250","customizableui-special-spring246","customizableui-special-spring245","customizableui-special-spring242","customizableui-special-spring240","customizableui-special-spring239","customizableui-special-spring236","downloads-button","forward-button","ublock0_raymondhill_net-browser-action","unified-extensions-button"]');
clearPref("browser.uiCustomization.state"); // Temporary, to ensure our new setting below takes effect, due to how Firefox handles this
defaultPref("browser.uiCustomization.state", '{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":[],"nav-bar":["vertical-spacer","screenshot-button","back-button","forward-button","customizableui-special-spring232","customizableui-special-spring233","customizableui-special-spring237","customizableui-special-spring238","customizableui-special-spring241","customizableui-special-spring243","customizableui-special-spring244","customizableui-special-spring247","customizableui-special-spring249","customizableui-special-spring253","customizableui-special-spring256","customizableui-special-spring259","customizableui-special-spring262","customizableui-special-spring265","customizableui-special-spring268","customizableui-special-spring271","customizableui-special-spring274","customizableui-special-spring278","customizableui-special-spring281","customizableui-special-spring284","customizableui-special-spring287","customizableui-special-spring290","customizableui-special-spring293","customizableui-special-spring296","customizableui-special-spring303","customizableui-special-spring304","customizableui-special-spring308","customizableui-special-spring310","customizableui-special-spring313","customizableui-special-spring315","customizableui-special-spring318","customizableui-special-spring322","customizableui-special-spring324","customizableui-special-spring327","stop-reload-button","urlbar-container","home-button","customizableui-special-spring339","customizableui-special-spring326","customizableui-special-spring323","customizableui-special-spring321","customizableui-special-spring317","customizableui-special-spring314","customizableui-special-spring312","customizableui-special-spring309","customizableui-special-spring307","customizableui-special-spring305","customizableui-special-spring302","customizableui-special-spring295","customizableui-special-spring292","customizableui-special-spring289","customizableui-special-spring286","customizableui-special-spring283","customizableui-special-spring280","customizableui-special-spring277","customizableui-special-spring273","customizableui-special-spring270","customizableui-special-spring267","customizableui-special-spring264","customizableui-special-spring261","customizableui-special-spring258","customizableui-special-spring255","customizableui-special-spring252","customizableui-special-spring250","customizableui-special-spring246","customizableui-special-spring245","customizableui-special-spring242","customizableui-special-spring240","customizableui-special-spring239","customizableui-special-spring236","downloads-button","ublock0_raymondhill_net-browser-action","unified-extensions-button","fullscreen-button"],"TabsToolbar":[],"vertical-tabs":["tabbrowser-tabs"],"PersonalToolbar":["personal-bookmarks"],"toolbar-menubar":["menubar-items"]},"seen":[],"dirtyAreaCache":["nav-bar","vertical-tabs","PersonalToolbar","unified-extensions-area","TabsToolbar","toolbar-menubar"],"currentVersion":23,"newElementCount":339}');

/// Hide UI to add custom search engines at `about:preferences#search`
defaultPref("browser.urlbar.update2.engineAliasRefresh", false);

/// Hide UI to automatically delete files downloaded in Private Browsing
defaultPref("browser.download.enableDeletePrivate", false);

/// Hide UI to switch search engines for individual searches
defaultPref("browser.urlbar.scotchBonnet.disableOneOffs", true); // [HIDDEN]

/// If containers are enabled, set Firefox to always ask for container selection on new tabs
// Useful for having multiple accounts/instances of websites
defaultPref("privacy.userContext.newTabContainerOnLeftClick.enabled", true);

/// Remove link to download themes
defaultPref("lightweightThemes.getMoreURL", "");

/// Remove placeholder shortcut
defaultPref("browser.newtabpage.pinned", ""); // [DEFAULT]

/// Remove unnecessary URL Bar shortcuts
defaultPref("browser.urlbar.shortcuts.bookmarks", false);
defaultPref("browser.urlbar.shortcuts.history", false);
defaultPref("browser.urlbar.shortcuts.tabs", false);

defaultPref("browser.phoenix.status.specialized", "001");

/*** 002 DEBLOAT ***/

// These also provide Attack Surface Reduction

/// Disable add-on abuse reporting
defaultPref("extensions.abuseReport.enabled", false);

/// Disable alerts for breached and vulnerable passwords
defaultPref("browser.contentblocking.report.monitor.home_page_url", "");
defaultPref("browser.contentblocking.report.monitor.how_it_works.url", "");
defaultPref("browser.contentblocking.report.monitor.preferences_url", "");
defaultPref("browser.contentblocking.report.monitor.sign_in_url", "");
defaultPref("browser.contentblocking.report.monitor.url", "");
defaultPref("signon.management.page.breach-alerts.enabled", false);
defaultPref("signon.management.page.breachAlertUrl", "");
defaultPref("signon.management.page.vulnerable-passwords.enabled", false);

/// Disable Android Debugging
defaultPref("devtools.remote.adb.extensionID", "");
defaultPref("devtools.remote.adb.extensionURL", "");

/// Disable back-up/export of bookmarks
defaultPref("browser.bookmarks.autoExportHTML", false); // [DEFAULT]
defaultPref("browser.bookmarks.max_backups", 0);

/// Disable background tasks
defaultPref("dom.quotaManager.backgroundTask.enabled", false); // [DEFAULT]
defaultPref("network.cache.shutdown_purge_in_background_task", false); // [DEFAULT]

/// Disable BackupService
// https://searchfox.org/firefox-main/source/browser/components/backup/content/debug.html
defaultPref("browser.backup.archive.enabled", false); // [DEFAULT]
defaultPref("browser.backup.enabled", false);
defaultPref("browser.backup.preferences.ui.enabled", false); // [DEFAULT]
defaultPref("browser.backup.restore.enabled", false); // [DEFAULT]
defaultPref("browser.backup.scheduled.enabled", false); // [DEFAULT]
defaultPref("browser.backup.scheduled.user-disabled", true);

/// Disable DRM/EME
defaultPref("media.eme.encrypted-media-encryption-scheme.enabled", false);
defaultPref("media.eme.hdcp-policy-check.enabled", false);
defaultPref("media.gmp-widevinecdm.visible", false);
defaultPref("media.gmp-widevinecdm-l1.visible", false); // [DEFAULT - non-Nightly]

/// Disable file picker dialogs
defaultPref("widget.disable_file_pickers", true);
defaultPref("widget.use-xdg-desktop-portal.file-picker", 0); // Linux (GTK)

/// Disable Firefox Bridge
defaultPref("browser.firefoxbridge.extensionOrigins", "");

/// Disable Firefox Home
defaultPref("browser.newtab.preload", false);
defaultPref("browser.newtabpage.activity-stream.discoverystream.config", '{"collapsible":true,"enabled":false}');
defaultPref("browser.newtabpage.activity-stream.discoverystream.enabled", false);
defaultPref("browser.newtabpage.activity-stream.discoverystream.endpoints", "");
defaultPref("browser.newtabpage.activity-stream.discoverystream.merino-provider.enabled", false);
defaultPref("browser.newtabpage.activity-stream.discoverystream.merino-provider.endpoint", "");
defaultPref("browser.newtabpage.activity-stream.discoverystream.ohttp.configURL", "");
defaultPref("browser.newtabpage.activity-stream.discoverystream.ohttp.relayURL", "");
defaultPref("browser.newtabpage.activity-stream.feeds.aboutpreferences", false);
defaultPref("browser.newtabpage.activity-stream.feeds.discoverystreamfeed", false);
defaultPref("browser.newtabpage.activity-stream.feeds.listsfeed", false);
defaultPref("browser.newtabpage.activity-stream.feeds.newtabinit", false);
defaultPref("browser.newtabpage.activity-stream.feeds.places", false);
defaultPref("browser.newtabpage.activity-stream.feeds.prefs", false);
defaultPref("browser.newtabpage.activity-stream.feeds.recommendationprovider", false);
defaultPref("browser.newtabpage.activity-stream.feeds.sections", false);
defaultPref("browser.newtabpage.activity-stream.feeds.smartshortcutsfeed", false);
defaultPref("browser.newtabpage.activity-stream.feeds.startupcacheinit", false);
defaultPref("browser.newtabpage.activity-stream.feeds.system.topsites", false);
defaultPref("browser.newtabpage.activity-stream.feeds.systemtick", false);
defaultPref("browser.newtabpage.activity-stream.feeds.timerfeed", false);
defaultPref("browser.newtabpage.activity-stream.feeds.topsites", false);
defaultPref("browser.newtabpage.activity-stream.feeds.trendingsearchfeed", false);
defaultPref("browser.newtabpage.activity-stream.feeds.weatherfeed", false);
defaultPref("browser.newtabpage.activity-stream.newtabWallpapers.enabled", false);
defaultPref("browser.newtabpage.activity-stream.showSearch", false);
defaultPref("browser.newtabpage.activity-stream.support.url", "");
defaultPref("browser.newtabpage.activity-stream.system.showWeather", false);
defaultPref("browser.newtabpage.activity-stream.testing.shouldInitializeFeeds", false);
defaultPref("browser.newtabpage.activity-stream.widgets.focusTimer.enabled", false);
defaultPref("browser.newtabpage.activity-stream.widgets.lists.enabled", false);
defaultPref("browser.newtabpage.activity-stream.widgets.system.enabled", false); // [DEFAULT]
defaultPref("browser.newtabpage.activity-stream.widgets.system.focusTimer.enabled", false); // [DEFAULT]
defaultPref("browser.newtabpage.activity-stream.widgets.system.lists.enabled", false); // [DEFAULT]
defaultPref("browser.newtabpage.enabled", false);
defaultPref("browser.startup.homepage.abouthome_cache.enabled", false);

/// Disable Firefox Relay
defaultPref("signon.firefoxRelay.base_url", "");
defaultPref("signon.firefoxRelay.feature", "not available");
defaultPref("signon.firefoxRelay.learn_more_url", "");
defaultPref("signon.firefoxRelay.manage_url", "");
defaultPref("signon.firefoxRelay.privacy_policy_url", "");
defaultPref("signon.firefoxRelay.terms_of_service_url", "");

/// Disable Firefox Sync
defaultPref("identity.fxaccounts.auth.uri", "");
defaultPref("identity.fxaccounts.autoconfig.uri", ""); // [DEFAULT]
defaultPref("identity.fxaccounts.commands.remoteTabManagement.enabled", false);
defaultPref("identity.fxaccounts.enabled", false);
defaultPref("identity.fxaccounts.oauth.enabled", false);
defaultPref("identity.fxaccounts.pairing.enabled", false);
defaultPref("identity.fxaccounts.remote.oauth.uri", "");
defaultPref("identity.fxaccounts.remote.pairing.uri", "");
defaultPref("identity.fxaccounts.remote.profile.uri", "");
defaultPref("identity.fxaccounts.remote.root", "");
defaultPref("identity.fxaccounts.toolbar.defaultVisible", false); // Hide toolbar icon
defaultPref("identity.fxaccounts.toolbar.enabled", false);
defaultPref("identity.sync.tokenserver.uri", "");
defaultPref("services.sync.addons.trustedSourceHostnames", "");
defaultPref("services.sync.engine.addresses.available", false); // [DEFAULT]
defaultPref("services.sync.engine.creditcards.available", false);
defaultPref("services.sync.syncedTabs.showRemoteIcons", false);
defaultPref("webextensions.storage.sync.enabled", false); // [HIDDEN]
defaultPref("webextensions.storage.sync.kinto", false); // [DEFAULT]
defaultPref("webextensions.storage.sync.serverURL", "");

/// Disable Firefox View virtual list
defaultPref("browser.firefox-view.virtual-list.enabled", false);

/// Disable link preview
defaultPref("browser.ml.linkPreview.noKeyPointsRegions", "xx");

/// Disable machine learning
defaultPref("browser.ml.chat.provider", "");
defaultPref("browser.ml.modelHubRootUrl", "");

/// Disable 'Migration' functionality...
defaultPref("browser.migrate.bookmarks-file.enabled", false);
defaultPref("browser.migrate.brave.enabled", false);
defaultPref("browser.migrate.canary.enabled", false);
defaultPref("browser.migrate.chrome.enabled", false);
defaultPref("browser.migrate.chrome.extensions.enabled", false);
defaultPref("browser.migrate.chrome.get_permissions.enabled", false);
defaultPref("browser.migrate.chrome.payment_methods.enabled", false);
defaultPref("browser.migrate.chrome-beta.enabled", false);
defaultPref("browser.migrate.chrome-dev.enabled", false);
defaultPref("browser.migrate.chromium.enabled", false);
defaultPref("browser.migrate.chromium-360se.enabled", false);
defaultPref("browser.migrate.chromium-edge.enabled", false);
defaultPref("browser.migrate.chromium-edge-beta.enabled", false);
defaultPref("browser.migrate.content-modal.import-all.enabled", false);
defaultPref("browser.migrate.edge.enabled", false);
defaultPref("browser.migrate.firefox.enabled", false);
defaultPref("browser.migrate.ie.enabled", false);
defaultPref("browser.migrate.interactions.bookmarks", false);
defaultPref("browser.migrate.interactions.csvpasswords", false);
defaultPref("browser.migrate.interactions.history", false);
defaultPref("browser.migrate.interactions.passwords", false);
defaultPref("browser.migrate.opera.enabled", false);
defaultPref("browser.migrate.opera-gx.enabled", false);
defaultPref("browser.migrate.preferences-entrypoint.enabled", false);
defaultPref("browser.migrate.safari.enabled", false);
defaultPref("browser.migrate.vivaldi.enabled", false);
defaultPref("extensions.getAddons.browserMappings.url", ""); // This is used for mapping Chrome extensions with Firefox ones, as part of browser migration: https://mozilla.github.io/addons-server/topics/api/addons.html#browser-mappings - ex. https://services.addons.mozilla.org/api/v5/addons/browser-mappings/?browser=chrome
defaultPref("signon.showAutoCompleteImport", "");
defaultPref("signon.suggestImportCount", 0);

/// Disable Narrator
defaultPref("narrate.enabled", false);

/// Disable Password Manager/Autofill
defaultPref("browser.contentblocking.report.lockwise.how_it_works.url", "");
defaultPref("browser.contextual-password-manager.enabled", false);
defaultPref("extensions.formautofill.addresses.capture.enabled", false);
defaultPref("extensions.formautofill.addresses.experiments.enabled", false); // [DEFAULT - non-Android]
defaultPref("extensions.formautofill.addresses.supported", "off");
defaultPref("extensions.formautofill.addresses.supportedCountries", "");
defaultPref("extensions.formautofill.creditCards.hideui", true); // [HIDDEN] https://searchfox.org/firefox-release/rev/9d94f5e3/toolkit/components/formautofill/FormAutofill.sys.mjs#29
defaultPref("extensions.formautofill.creditCards.supported", "off");
defaultPref("extensions.formautofill.creditCards.supportedCountries", "");
defaultPref("security.webauthn.show_ms_settings_link", false);
defaultPref("services.passwordSavingEnabled", false); // [HIDDEN]
defaultPref("signon.backup.enabled", false);
defaultPref("signon.capture.inputChanges.enabled", false);
defaultPref("signon.formRemovalCapture.enabled", false);
defaultPref("signon.generation.available", false);
defaultPref("signon.generation.enabled", false);
defaultPref("signon.passwordEditCapture.enabled", false);
defaultPref("signon.recipes.path", "");
defaultPref("signon.relatedRealms.enabled", false); // [DEFAULT]
defaultPref("signon.showAutoCompleteFooter", false);
defaultPref("signon.storeSignons", false); // [HIDDEN]
defaultPref("signon.usernameOnlyForm.enabled", false);

/// Disable PDF.js
defaultPref("browser.helperApps.showOpenOptionForPdfJS", false);

/// Disable Picture-in-Picture
defaultPref("media.videocontrols.picture-in-picture.audio-toggle.enabled", false);
defaultPref("media.videocontrols.picture-in-picture.enabled", false);
defaultPref("media.videocontrols.picture-in-picture.urlbar-button.enabled", false);
defaultPref("media.videocontrols.picture-in-picture.video-toggle.enabled", false);

/// Disable printing
defaultPref("print.enabled", false);
defaultPref("print.show_page_setup_menu", false);

/// Disable Reader Mode
defaultPref("reader.parse-on-load.enabled", false);

/// Disable support for web applications manifests
defaultPref("dom.manifest.enabled", false);

/// Disable Taskbar Tabs (PWAs)
defaultPref("browser.taskbarTabs.enabled", false);

/// Disable text fragments
defaultPref("dom.text_fragments.create_text_fragment.enabled", false);
defaultPref("dom.text_fragments.enabled", false);

/// Disable user certificate/key databases
defaultPref("security.nocertdb", true);

/// Disable Web Compatibility interventions
defaultPref("extensions.pictureinpicture.enable_picture_in_picture_overrides", false); // [HIDDEN]
defaultPref("extensions.webcompat.enable_interventions", false);  // [HIDDEN]
defaultPref("extensions.webcompat.perform_injections", false); // [HIDDEN]
defaultPref("extensions.webcompat.perform_ua_overrides", false); // [HIDDEN]

/// Do not try to open internally-handled attachments
defaultPref("browser.download.force_save_internally_handled_attachments", true);
defaultPref("browser.download.viewableInternally.enabledTypes", "");
defaultPref("browser.helperApps.showOpenOptionForViewableInternally", false);

defaultPref("browser.phoenix.status.specialized", "002");

/*** 003 PRIVACY + SECURITY ***/

/// Block websites from prompting to access apps and services (outside of the browser) on your device
defaultPref("permissions.default.localhost", 2);

/// Disable screensharing
// https://developer.mozilla.org/docs/Web/API/Screen_Capture_API/Using_Screen_Capture
defaultPref("media.getusermedia.browser.enabled", false); // [DEFAULT - non-Nightly]
defaultPref("media.getusermedia.screensharing.enabled", false);
defaultPref("permissions.default.screen", 2); // [HIDDEN]

/// Disable WebGL
// PRIVACY: Fingerprinting concerns
// SECURITY: Attack Surface Reduction
// https://blog.browserscan.net/docs/webgl-fingerprinting
// https://security.stackexchange.com/questions/13799/is-webgl-a-security-concern
defaultPref("webgl.disabled", true);

defaultPref("browser.phoenix.status.specialized", "003");

/*** 004 PRIVACY ***/

/// Clear cookies by default at `about:preferences#privacy` -> `Cookies and Site Data` -> `Manage Data...`
// We don't have to worry about exceptions for our use case...
defaultPref("privacy.clearHistory.cookiesAndStorage", true); // [DEFAULT]
defaultPref("privacy.clearSiteData.cookiesAndStorage", true); // [DEFAULT]
defaultPref("privacy.cpd.cookies", true); // [DEFAULT]
defaultPref("privacy.cpd.offlineApps", true);

/// Disable browsing history
defaultPref("places.history.enabled", false);

/// Disable clipboard events
// https://developer.mozilla.org/docs/Web/API/ClipboardEvent
defaultPref("dom.event.clipboardevents.enabled", false);

/// Disable frecency
defaultPref("places.frecency.unvisitedBookmarkBonus", 0);

/// Disable geolocation
defaultPref("browser.geolocation.warning.infoURL", "");
defaultPref("geo.prompt.open_system_prefs", false); // Ensure users aren't prompted to open settings and enable Geolocation - https://searchfox.org/mozilla-central/rev/20fc11f1/modules/libpref/init/StaticPrefList.yaml#6406
defaultPref("geo.provider.network.scan", false);
defaultPref("geo.provider.network.url", "");
defaultPref("geo.provider.use_corelocation", false); // [OSX-ONLY]
defaultPref("geo.provider.use_geoclue", false); // [LINUX-ONLY]
defaultPref("network.wifi.scanning_period", 0);
defaultPref("widget.use-xdg-desktop-portal.location", 0); // [LINUX-ONLY]

/// Disable origin headers
defaultPref("network.http.sendOriginHeader", 0);

/// Disable referers
// https://wiki.mozilla.org/Security/Referrer
defaultPref("network.http.referer.defaultPolicy", 0);
defaultPref("network.http.referer.defaultPolicy.pbmode", 0);
defaultPref("network.http.referer.defaultPolicy.trackers", 0);
defaultPref("network.http.referer.defaultPolicy.trackers.pbmode", 0);
defaultPref("network.http.referer.sendFromRefresh", false);
defaultPref("network.http.referer.trimmingPolicy", 2);
defaultPref("network.http.sendRefererHeader", 0);

/// Disable session (re)store
defaultPref("browser.sessionstore.cleanup.forget_closed_after", 1);
defaultPref("browser.sessionstore.closedTabsFromAllWindows", false);
defaultPref("browser.sessionstore.closedTabsFromClosedWindows", false);
defaultPref("browser.sessionstore.debug.no_auto_updates", true);
defaultPref("browser.sessionstore.max_resumed_crashes", 0);
defaultPref("browser.sessionstore.max_serialize_back", 0);
defaultPref("browser.sessionstore.max_serialize_forward", 0);
defaultPref("browser.sessionstore.max_tabs_undo", 0);
defaultPref("browser.sessionstore.max_windows_undo", 0);
defaultPref("browser.sessionstore.resume_from_crash", false);
defaultPref("browser.sessionstore.resume_session_once", false); // [DEFAULT]
defaultPref("browser.sessionstore.resuming_after_os_restart", false); // [DEFAULT]
defaultPref("browser.sessionstore.restore_on_demand", false);
defaultPref("browser.sessionstore.restore_windows_to_virtual_desktop", false);
defaultPref("browser.sessionstore.persist_closed_tabs_between_sessions", false);
defaultPref("browser.sessionstore.upgradeBackup.maxUpgradeBackups", 0);
defaultPref("browser.startup.couldRestoreSession.count", -1);
defaultPref("privacy.clearOnShutdown.openWindows", true);
defaultPref("privacy.cpd.openWindows", true);

/// Limit session history
// Controls how many pages are stored for ex. back and forward buttons
defaultPref("browser.sessionhistory.max_entries", 10); // [DEFAULT: 50]

/// On first launch, load a blank homepage
// For specialized configs, we override the homepage to one that belongs to the desired website/service for the config
// But, if we immediately load the webpage on first run, it will bypass uBlock Origin, as uBlock Origin won't be installed yet
// So, to give uBlock Origin time to install, we can set this to a blank/empty homepage, only for the first run
defaultPref("browser.startup.firstrunSkipsHomepage", true); // [DEFAULT]
unlockPref("browser.startup.homepage_override.mstone");
defaultPref("browser.startup.homepage_override.mstone", "");
defaultPref("startup.homepage_welcome_url", "file:///etc/firefox/phoenix/assets/spec-welcome.txt"); // [LINUX-NON-FLATPAK-ONLY]
defaultPref("startup.homepage_welcome_url", "file:///app/etc/firefox/phoenix/assets/spec-welcome.txt"); // [FLATPAK-LINUX-ONLY]
defaultPref("startup.homepage_welcome_url", "file:///opt/homebrew/opt/phoenix-osx/assets/spec-welcome.txt"); // [SILICON-OSX-ONLY]
defaultPref("startup.homepage_welcome_url", "file:///usr/local/opt/phoenix-intel/assets/spec-welcome.txt"); // [INTEL-OSX-ONLY]
defaultPref("startup.homepage_welcome_url", "file:///C:/phoenix/assets/spec-welcome.txt"); // [WINDOWS-ONLY]

/// Reset Phoenix's FPP overrides
// Unnecessary/undesired for our use case...
defaultPref("privacy.fingerprintingProtection.granularOverrides", ""); // [DEFAULT]

/// Sanitize data on exit
defaultPref("network.cookie.noPersistentStorage", true); // [DEFENSE IN DEPTH] Prevent storing cookies persistently https://bugzilla.mozilla.org/show_bug.cgi?id=1675829
defaultPref("privacy.clearOnShutdown.cookies", true); // [DEFAULT]
defaultPref("privacy.clearOnShutdown.offlineApps", true);
defaultPref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); // [DEFAULT]

defaultPref("browser.phoenix.status.specialized", "004");

/*** 005 SECURITY ***/

/// Block permission prompts to access camera
defaultPref("permissions.default.camera", 2);

/// Block permission prompts to access microphone
defaultPref("permissions.default.microphone", 2);

/// Configure protocol handling
defaultPref("network.protocol-handler.expose.file", false);
defaultPref("network.protocol-handler.expose.http", false);
defaultPref("network.protocol-handler.expose.https", false);
defaultPref("network.protocol-handler.expose.javascript", false);
defaultPref("network.protocol-handler.external.file", true);
defaultPref("network.protocol-handler.external.javascript", true);

/// Disable SVG
// https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=firefox+svg
defaultPref("svg.disabled", true);

/// Disable WebRTC
// https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=webrtc
// https://x.com/GrapheneOS/status/1728921946396725618
defaultPref("media.peerconnection.enabled", false);

defaultPref("browser.phoenix.status.specialized", "005");

/*** 006 MISC. ***/

/// Always open links in existing browser window
defaultPref("browser.link.open_newwindow", 1);
defaultPref("browser.link.open_newwindow.disabled_in_fullscreen", false);
defaultPref("browser.link.open_newwindow.restriction", 1);
defaultPref("browser.link.open_newwindow.override.external", 1);
defaultPref("browser.search.context.loadInBackground", false); // [DEFAULT]
defaultPref("browser.tabs.loadBookmarksInBackground", false); // [DEFAULT]
defaultPref("browser.tabs.loadBookmarksInTabs", false); // [DEFAULT]
defaultPref("browser.tabs.loadDivertedInBackground", false); // [DEFAULT]
defaultPref("browser.tabs.loadInBackground", false);
defaultPref("browser.tabs.opentabfor.middleclick", false);
defaultPref("middlemouse.openNewWindow", false); // [DEFAULT - non-Android/non-Unix (non-macOS)]
defaultPref("view_source.tab", false);

/// Close tabs upon double click
// This is to compensate for us disabling the display of separate tabs
defaultPref("browser.tabs.closeTabByDblclick", true);

/// Disable favicons
defaultPref("browser.chrome.guess_favicon", false); // [HIDDEN]
defaultPref("browser.chrome.site_icons", false);

/// Disable saving links upon left click + save
// https://searchfox.org/firefox-release/rev/9d94f5e3/toolkit/modules/BrowserUtils.sys.mjs#471
defaultPref("browser.altClickSave", false); // [DEFAULT]

/// Disable tab switching with Ctrl+Tab
defaultPref("browser.ctrlTab.disallowForScreenReaders", true); // [HIDDEN]

/// Disable tab warming
// https://searchfox.org/firefox-main/rev/655ba8ea/browser/base/content/docs/tabbrowser/async-tab-switcher.rst#206
defaultPref("browser.tabs.remote.warmup.enabled", false);
defaultPref("browser.tabs.remote.warmup.maxTabs", 1);

/// Disable toolbar keyboard navigation
defaultPref("browser.toolbars.keyboard_navigation", false);

/// Disable URL fix-up
defaultPref("browser.fixup.alternate.prefix", "");
defaultPref("browser.fixup.alternate.protocol", "");
defaultPref("browser.fixup.alternate.suffix", "");
defaultPref("browser.fixup.typo.scheme", false); // [HIDDEN]
defaultPref("browser.urlbar.ctrlCanonizesURLs", false);
defaultPref("browser.urlbar.dnsResolveFullyQualifiedNames", false); // [HIDDEN]
defaultPref("security.bad_cert_domain_error.url_fix_enabled", false); // https://searchfox.org/firefox-main/rev/82e2435f/docshell/base/nsDocShell.cpp#6251

/// Do not attempt to resume background video playback upon tab hover
defaultPref("media.resume-background-video-on-tabhover", false);

/// Do not go back and forward via mouse shortcuts
// https://searchfox.org/firefox-main/rev/655ba8ea/browser/app/profile/firefox.js#1301
// https://searchfox.org/firefox-main/rev/655ba8ea/modules/libpref/init/all.js#1809
defaultPref("mousebutton.4th.enabled", false);
defaultPref("mousebutton.5th.enabled", false);
defaultPref("mousewheel.with_alt.action", 1);

/// Do not try to switch tabs by scrolling
defaultPref("toolkit.tabbox.switchByScrolling", false); // [DEFAULT]

/// Do not try to update the zoom level for background tabs
defaultPref("browser.zoom.updateBackgroundTabs", false);

/// Do not try to unload tabs on low memory
defaultPref("browser.tabs.unloadOnLowMemory", false); // [DEFAULT - non-macOS/Windows]

/// Do not warn on closing tabs
defaultPref("browser.tabs.warnOnClose", false); // [DEFAULT]
defaultPref("browser.tabs.warnOnCloseOtherTabs", false);

/// Do not warn on quit
defaultPref("browser.warnOnQuit", false);
defaultPref("browser.warnOnQuitShortcut", false); // [DEFAULT - Windows]

/// Enable audio focus management
// This prevents multiple audio controllers from playing at the same time
// (So, ex. - if you have multiple tabs open and playing audio at the same time, this only allows the most recent tab to play audio)
// https://searchfox.org/firefox-main/rev/5a5b3741/dom/media/mediacontrol/AudioFocusManager.cpp#41
// Ideal for our use case
defaultPref("media.audioFocus.management", true);

/// Ensure we don't try to load various URLs internally
// We're intentionally using "htps" here - because, since we disable URL fix-up below, this prevents these URLs from loading in the specialized config - but, since regular Phoenix/Firefox profiles have URL fix-up enabled, when pasting the URL into the URL bar there, it will automatically switch to HTTPS and take users to the correct place
// For other URLs that we don't want/need at all here, we can just set them to empty values
lockPref("app.releaseNotesURL", "");
lockPref("app.releaseNotesURL.aboutDialog", "");
lockPref("app.releaseNotesURL.prompt", "");
defaultPref("app.support.baseURL", "htps://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/");
lockPref("app.update.url.details", "");
lockPref("app.update.url.manual", "");
defaultPref("browser.backup.template.fallback-download.aurora", "");
defaultPref("browser.backup.template.fallback-download.beta", "");
defaultPref("browser.backup.template.fallback-download.esr", "");
defaultPref("browser.backup.template.fallback-download.nightly", "");
defaultPref("browser.backup.template.fallback-download.release", "");
defaultPref("browser.contentblocking.report.cookie.url", "htps://support.mozilla.org/kb/trackers-and-scripts-firefox-blocks-enhanced-track#w_cross-site-tracking-cookies");
defaultPref("browser.contentblocking.report.cryptominer.url", "htps://support.mozilla.org/kb/trackers-and-scripts-firefox-blocks-enhanced-track#w_cryptominers");
defaultPref("browser.contentblocking.report.fingerprinter.url", "htps://support.mozilla.org/kb/trackers-and-scripts-firefox-blocks-enhanced-track#w_fingerprinters");
defaultPref("browser.contentblocking.report.social.url", "htps://support.mozilla.org/kb/trackers-and-scripts-firefox-blocks-enhanced-track#w_social-media-trackers");
defaultPref("browser.contentblocking.report.tracker.url", "htps://support.mozilla.org/kb/trackers-and-scripts-firefox-blocks-enhanced-track#w_tracking-content");
defaultPref("browser.dictionaries.download.url", "htps://addons.mozilla.org/language-tools/");
defaultPref("browser.lna.warning.infoURL", "htps://support.mozilla.org/kb/control-personal-device-local-network-permissions-firefox");
defaultPref("browser.safebrowsing.provider.google.advisoryURL", "htps://developers.google.com/safe-browsing/v4/advisory");
defaultPref("browser.safebrowsing.provider.google4.advisoryURL", "htps://developers.google.com/safe-browsing/v4/advisory");
defaultPref("browser.safebrowsing.provider.google5.advisoryURL", "htps://developers.google.com/safe-browsing/v4/advisory");
defaultPref("browser.safebrowsing.reportPhishURL", "htps://safebrowsing.google.com/safebrowsing/report_phish/?tpl=mozilla&url=");
defaultPref("browser.xr.warning.infoURL", "");
defaultPref("extensions.abuseReport.amoFormURL", "");
defaultPref("extensions.blocklist.addonItemURL", "htps://addons.mozilla.org/blocked-addon/%addonID%/%addonVersion%/");
defaultPref("extensions.webcompat-reporter.newIssueEndpoint", "htps://phoenix.celenity.dev/issues");
defaultPref("media.decoder-doctor.new-issue-endpoint", "htps://phoenix.celenity.dev/issues");
defaultPref("network.trr_ui.skip_reason_learn_more_url");
defaultPref("pdfjs.altTextLearnMoreUrl", "htps://firefox-source-docs.mozilla.org/networking/dns/trr-skip-reasons.html#");
defaultPref("ui.new-webcompat-reporter.new-report-endpoint", "htps://phoenix.celenity.dev/issues");

/// Remove default Search Engine Placeholders
defaultPref("browser.newtabpage.activity-stream.trendingSearch.defaultSearchEngine", ""); // [HIDDEN] [DEFAULT] [NIGHTLY] For the "Trending search results" widget on Firefox Home (`about:home`) https://searchfox.org/mozilla-central/source/browser/extensions/newtab/lib/TrendingSearchFeed.sys.mjs
defaultPref("browser.urlbar.placeholderName", "");
defaultPref("browser.urlbar.placeholderName.private", "");

/// Suspend inactive (background) tabs
// This is the default for Android - it's useful for us because, for this use case, we don't want background tabs
defaultPref("dom.suspend_inactive.enabled", true);

defaultPref("browser.phoenix.status.specialized", "006");

lockPref("browser.phoenix.status.specialized", "successfully applied :D");
//

//
// Copyright (C) 2024-2026 celenity
//
// This file is part of Phoenix.
//
// Phoenix is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// Phoenix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Phoenix. If not, see https://www.gnu.org/licenses/.
//

// This contains preferences specifically tailored for Photopea.

/// Add custom branding at `about:support`
defaultPref("app.support.vendor", "Phoenix - Photopea SC: {PHOENIX_VERSION}"); // [HIDDEN]

/// Add custom branding under `Firefox Updates` at `about:preferences#general`
// This will unfortunately only display if the version of Firefox you're using is repackaged (ex. Flatpaks/Linux distros)
lockPref("distribution.about", "Phoenix - Photopea SC for Mozilla Firefox: {PHOENIX_VERSION} 💜"); // [HIDDEN]

/* INDEX 

001: DEBLOAT
002: PRIVACY + SECURITY
003: UNBREAK

*/

/// Load Photopea...
defaultPref("browser.startup.homepage", "https://www.photopea.com/");

/*** 001 DEBLOAT ***/

/// Disable Cookie Banner Reduction
// https://support.mozilla.org/kb/cookie-banner-reduction
defaultPref("cookiebanners.bannerClicking.enabled", false);
defaultPref("cookiebanners.cookieInjector.enabled", false);
defaultPref("cookiebanners.listService.testSkipRemoteSettings", true);
defaultPref("cookiebanners.service.mode", 0); // [DEFAULT]
defaultPref("cookiebanners.service.mode.privateBrowsing", 0); // [DEFAULT]
defaultPref("cookiebanners.service.enableGlobalRules", false);
defaultPref("cookiebanners.service.enableGlobalRules.subFrames", false);
defaultPref("cookiebanners.ui.desktop.enabled", false); // [DEFAULT]

defaultPref("browser.phoenix.status.specialized.photopea", "001");

/*** 002 PRIVACY + SECURITY ***/

/// Block Private Network Access requests unconditionally
defaultPref("network.lna.blocking", true);

defaultPref("browser.phoenix.status.specialized.photopea", "002");

/*** 003 UNBREAK ***/

/// Re-enable file picker dialogs
defaultPref("widget.disable_file_pickers", false); // [DEFAULT]

/// Re-enable SVG
defaultPref("svg.disabled", false); // [DEFAULT]

/// Re-enable tooltips
defaultPref("browser.chrome.toolbar_tips", true); // [DEFAULT]

/// Re-enable WebAssembly
defaultPref("javascript.options.wasm", true); // [DEFAULT]

/// Re-enable WebGL
defaultPref("webgl.disabled", false); // [DEFAULT]

defaultPref("browser.phoenix.status.specialized.photopea", "003");

lockPref("browser.phoenix.status.specialized.photopea", "successfully applied :D");
