null;

/** r3dfox FORK OF LIBREWOLF SETTINGS
 *
 * This is a modified version of librewolf.cfg with the minimal preferences required for r3dfox.
 * Plus locking some preferences because Mozilla really wants to change them.
 *
 * If you want to use stock librewolf.cfg, change general.config.filename to librewolf.cfg and grab it
 * from here https://codeberg.org/librewolf/settings/src/branch/master/librewolf.cfg or the latest version.
 *
 * WARNING: make sure the first line of this file is empty. this is a known bug.
 */

defaultPref("browser.contentblocking.category", "strict");

/** [SECTION] QUERY STRIPPING
 * currently we set the same query stripping and allow list that brave uses:
 * https://github.com/brave/brave-core/blob/31d1281d572590225062ea510bddb9c87bfc06a2/components/query_filter/utils.cc#L26-L127
 * https://github.com/brave/brave-core/blob/31d1281d572590225062ea510bddb9c87bfc06a2/components/query_filter/utils.cc#L166
 */
defaultPref(
  "privacy.query_stripping.strip_list",
  "__hsfp __hssc __hstc __s _bhlid _branch_match_id _branch_referrer _gl _hsenc _kx _openstat at_recipient_id at_recipient_list bbeml bsft_clkid bsft_uid dclid et_rid fb_action_ids fb_comment_id fbclid gclid guce_referrer guce_referrer_sig hsCtaTracking irclickid mc_eid ml_subscriber ml_subscriber_hash msclkid mtm_cid oft_c oft_ck oft_d oft_id oft_ids oft_k oft_lk oft_sk oly_anon_id oly_enc_id pk_cid rb_clickid s_cid sc_customer sc_eh sc_uid sms_click sms_source sms_uph srsltid ss_email_id syclid ttclid twclid unicorn_click_id vero_conv vero_id vgo_ee wbraid wickedid yclid ymclid ysclid"
);
defaultPref("privacy.query_stripping.allow_list", "urldefense.com");

/** [SECTION] DOH */

// The current DoH providers are:
//  ->  LibreDNS, Quad9, Wikimedia, dns4all, Mullvad.
// For more providers: https://github.com/curl/curl/wiki/DNS-over-HTTPS

defaultPref(
  "doh-rollout.provider-list",
  `[
  {
    "UIName": "Quad9 (No Filtering)",
    "uri": "https://dns10.quad9.net/dns-query"
  },
  {
    "UIName": "Quad9 (Malware blocking)",
    "uri": "https://dns.quad9.net/dns-query"
  },
  {
    "UIName": "LibreDNS (No Filtering)",
    "uri": "https://doh.libredns.gr/dns-query"
  },
  {
    "UIName": "LibreDNS (Adblocking)",
    "uri": "https://doh.libredns.gr/noads"
  },
  {
    "UIName": "Wikimedia DNS (No Filtering)",
    "uri": "https://wikimedia-dns.org/dns-query"
  },
  {
    "UIName": "DNS4All (No Filtering)",
    "uri": "https://doh.dns4all.eu/dns-query"
  },
  {
    "UIName": "Mullvad (No Filtering)",
    "uri": "https://dns.mullvad.net/dns-query"
  }
]`
);

/** [SECTION] SAFE BROWSING
 * disable safe browsing, including the fetch of updates. reverting the 7 prefs below
 * allows to perform local checks and to fetch updated lists from google.
 */
defaultPref("browser.safebrowsing.malware.enabled", false);
defaultPref("browser.safebrowsing.phishing.enabled", false);
defaultPref("browser.safebrowsing.blockedURIs.enabled", false);
defaultPref("browser.safebrowsing.provider.google4.gethashURL", "");
defaultPref("browser.safebrowsing.provider.google4.updateURL", "");
defaultPref("browser.safebrowsing.provider.google.gethashURL", "");
defaultPref("browser.safebrowsing.provider.google.updateURL", "");
/** disable safe browsing checks on downloads, both local and remote. the resetting prefs
 * control remote checks, while the first one is for local checks only.
 */
defaultPref("browser.safebrowsing.downloads.enabled", false);
pref("browser.safebrowsing.downloads.remote.enabled", false);
pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false);
pref("browser.safebrowsing.downloads.remote.block_uncommon", false);
// empty for defense in depth
pref("browser.safebrowsing.downloads.remote.url", "");
pref("browser.safebrowsing.provider.google4.dataSharingURL", "");

// These usually get set by the new AI Controls
lockPref("browser.ai.control.default", "blocked");
lockPref("browser.ai.control.linkPreviewKeyPoints", "blocked");
lockPref("browser.ai.control.pdfjsAltText", "blocked");
lockPref("browser.ai.control.sidebarChatbot", "blocked");
lockPref("browser.ai.control.smartTabGroups", "blocked");

lockPref("browser.ai.control.translations", "blocked");

/** [SECTION] SYSTEM
 * built-in extension are not allowed to auto-update. additionally the reporter extension
 * of webcompat is disabled. urls are stripped for defense in depth.
 */
lockPref("extensions.webcompat-reporter.enabled", false);
lockPref("extensions.webcompat-reporter.newIssueEndpoint", "");

/** [SECTION] FIRST LAUNCH
 * disable what's new and ui tour on first start and updates. the browser
 * should also not stress user about being the default one.
 */
lockPref("startup.homepage_override_nimbus_disable_wnp", true);
lockPref("browser.uitour.enabled", false);
lockPref("browser.uitour.url", "");

/** [SECTION] NEW TAB PAGE
 * we want NTP to display nothing but the search bar without anything distracting.
 * the three prefs below are just for minimalism and they should be easy to revert for users.
 */
// hide stories and sponsored content from Firefox Home
lockPref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
lockPref("browser.newtabpage.activity-stream.showSponsored", false);
lockPref("browser.newtabpage.activity-stream.showSponsoredTopSites", false);
// disable telemetry in Firefox Home
lockPref("browser.newtabpage.activity-stream.feeds.telemetry", false);
lockPref("browser.newtabpage.activity-stream.telemetry", false);
// hide stories UI in about:preferences#home, empty highlights list
lockPref(
  "browser.newtabpage.activity-stream.feeds.section.topstories.options",
  '{"hidden":true}'
);
lockPref("browser.newtabpage.activity-stream.default.sites", "");

/** [SECTION] ABOUT
 * remove annoying ui elements from the about pages, including about:protections
 */
lockPref("browser.contentblocking.report.hide_vpn_banner", true);
lockPref("browser.contentblocking.report.vpn.enabled", false);
lockPref("browser.contentblocking.report.show_mobile_app", false);
lockPref("browser.vpn_promo.enabled", false);
lockPref("browser.promo.focus.enabled", false);

/** [SECTION] RECOMMENDED
 * disable all "recommend as you browse" activity.
 */
lockPref(
  "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features",
  false
);
lockPref(
  "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons",
  false
);

/** [SECTION] OTHERS
 * other unwanted UI
 */
// hide pxi ads on toolbar firefox sync button
lockPref("identity.fxaccounts.toolbar.pxiToolbarEnabled", false);
// remove the "send to device" tab by default from opt-in sidebar layout
defaultPref("sidebar.main.tools", "history");

// Until the new UI is finished upstream
lockPref("browser.settings-redesign.enabled", false);

/** ------------------------------
 * [CATEGORY] TELEMETRY
 * telemetry is already disabled elsewhere and most of the stuff in here is just for redundancy.
 * ------------------------------- */
lockPref("toolkit.telemetry.unified", false); // master switch
lockPref("toolkit.telemetry.enabled", false); // master switch
lockPref("toolkit.telemetry.server", "data:,");
lockPref("toolkit.telemetry.archive.enabled", false);
lockPref("toolkit.telemetry.newProfilePing.enabled", false);
lockPref("toolkit.telemetry.updatePing.enabled", false);
lockPref("toolkit.telemetry.firstShutdownPing.enabled", false);
lockPref("toolkit.telemetry.shutdownPingSender.enabled", false);
lockPref("toolkit.telemetry.bhrPing.enabled", false);
lockPref("toolkit.telemetry.cachedClientID", "");
lockPref("toolkit.telemetry.previousBuildID", "");
lockPref("toolkit.telemetry.server_owner", "");
lockPref("toolkit.coverage.opt-out", true); // hidden
lockPref("toolkit.telemetry.coverage.opt-out", true); // hidden
lockPref("toolkit.coverage.enabled", false);
lockPref("toolkit.coverage.endpoint.base", "");
lockPref("datareporting.healthreport.uploadEnabled", false);
lockPref("datareporting.policy.dataSubmissionEnabled", false);
// opt-out of normandy and studies
lockPref("app.normandy.enabled", false);
lockPref("app.normandy.api_url", "");
lockPref("app.shield.optoutstudies.enabled", false);
// disable personalized extension recommendations
lockPref("browser.discovery.enabled", false);
// disable crash report
lockPref("browser.tabs.crashReporting.sendReport", false);
lockPref("breakpad.reportURL", "");
lockPref("browser.crashReports.onDemand", false);
lockPref("browser.crashReports.requestedNeverShowAgain", true);
// disable daily usage pings
lockPref("datareporting.usage.uploadEnabled", false);
// disable setting server
lockPref("services.settings.server", "https://%.invalid") // set the remote settings URL (REMOTE_SETTINGS_SERVER_URL in the code)

// Disable and deregister the Glean add-on ping scheduler
	// https://codeberg.org/celenity/Phoenix/commit/1ff7ae1dbd3095c993a73af69c6bb2a6ad700c55
	lockPref("extensions.gleanPingAddons.daily.interval", 2147483647);
	lockPref("extensions.gleanPingAddons.updated.delay", 2147483647);
	lockPref("extensions.gleanPingAddons.updated.idleTimeout", 2147483647);
	lockPref("extensions.gleanPingAddons.updated.testing", false);
	clearPref("app.update.lastUpdateTime.glean-addons-daily");

/** ------------------------------
 * [CATEGORY] LIBREWOLF
 * prefs introduced by librewolf-specific patches
 * ------------------------------- */
defaultPref(
  "librewolf.uBO.assetsBootstrapLocation",
  "https://codeberg.org/librewolf/source/raw/branch/main/assets/uBOAssets.json"
);
defaultPref("librewolf.aboutMenu.checkVersion", false);
defaultPref("librewolf.hidePasswdmgr", false);
defaultPref("librewolf.debugger.force_detach", false);
defaultPref("librewolf.console.logging_disabled", false);
defaultPref(
  "librewolf.services.settings.allowedCollections",
  "security-state/*,main/tracking-protection-lists,main/public-suffix-list,main/translations-models-v2,main/translations-wasm-v2,main/translations-identification-models,main/addons-manager-settings,main/anti-tracking-url-decoration,main/hijack-blocklists,blocklists/gfx,blocklists/addons-bloomfilters,main/addons-data-leak-blocker-domains,main/cookie-banner-rules-list,main/query-stripping,blocklists/addons,blocklists/plugins,main/url-parser-default-unknown-schemes-interventions,main/webcompat-interventions" 
);
defaultPref(
  "librewolf.services.settings.allowedCollectionsFromDump",
  "main/search-config-v2,main/search-config-icons"
);

defaultPref("librewolf.getBrowserInfo.setToFirefoxDefaults", true);
