//

//
// 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 Google Maps.

/// Add custom branding at `about:support`
defaultPref("app.support.vendor", "Phoenix - Google Maps 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 - Google Maps SC for Mozilla Firefox: {PHOENIX_VERSION} 💜"); // [HIDDEN]

/* INDEX 

001: PRIVACY + SECURITY
002: PRIVACY
003: UNBREAK

*/

/// Load Google Maps...
defaultPref("browser.startup.homepage", "https://www.google.com/maps");

/*** 001 PRIVACY + SECURITY ***/

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

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

/*** 002 PRIVACY ***/

/// Expand domain blocklist
defaultPref("network.dns.localDomains", "250analytics.com,a.omappapi.com,activity-stream-icons.services.mozilla.com,ads.allizom.org,ads.mozilla.org,ads.nonprod.webservices.mozgcp.net,ads.prod.webservices.mozgcp.net,ads-img.mozilla.org,analytics.getpocket.com,analytics.google.com,analytics.withgoogle.com,anf1.fuzzing.mozilla.org,anonymco.com,api.divviup.org,asan-nightly-frontend-elb-1348905149.us-east-2.elb.amazonaws.com,braze.com,contile.services.mozilla.com,contile-images.services.mozilla.com,classify-client.nonprod.webservices.mozgcp.net,classify-client.prod.webservices.mozgcp.net,classify-client.services.mozilla.com,crash-reports.allizom.org,crash-reports.mozilla.com,crash-reports-xpsp2.mozilla.com,crash-stacks.mozilla.com,crash-stats.allizom.org,crash-stats.mozilla.com,crash-stats.mozilla.org,dap.services.mozilla.com,dap.nonprod.webservices.mozgcp.net,dap.prod.webservices.mozgcp.net,dap-09-3.api.divviup.org,data.mozilla.com,data-ingestion.prod.dataops.mozgcp.net,dataops.mozgcp.net,dataservices.mozgcp.net,debug-ping-preview.firebaseapp.com,discovery.addons.allizom.org,discovery.addons.mozilla.org,discovery.addons-dev.allizom.org,divviup.org,download-stats.mozilla.org,download-stats.r53-2.services.mozilla.com,experimenter.services.mozilla.com,experimenter.nonprod.webservices.mozgcp.net,experimenter.prod.webservices.mozgcp.net,fhr.data.mozilla.com,fhr.r53-2.services.mozilla.com,firefox-android-home-recommendations.getpocket.com,firefox-dns-perf-test.net,fuzzing.mozilla.org,google-analytics.com,google-analytics-cn.com,googleanalytics.com,googlesyndication.com,googlesyndication-cn.com,googletagmanager.com,googletagmanager-cn.com,googletagservices.com,googletagservices-cn.com,improving.duckduckgo.com,incoming.glean.example.com,incoming.telemetry.mozilla.org,incoming.thunderbird.net,incoming-telemetry.thunderbird.net,ingestion-edge.prod.dataops.mozgcp.net,location.services.mozilla.com,locprod1-elb-eu-west-1.prod.mozaws.net,locprod2-elb-us-west-2.prod.mozaws.net,metrics-content.duckduckgo.com,new-sentry.gitlab.net,nonprod.classify-client.nonprod.webservices.mozgcp.net,normandy.cdn.mozilla.net,normandy.nonprod.cloudops.mozgcp.net,normandy.prod.cloudops.mozgcp.net,normandy-cdn.services.mozilla.com,omappapi.com,pipeline-incoming-prod-elb-149169523.us-west-2.elb.amazonaws.com,prod.ads.prod.webservices.mozgcp.net,prod.classify-client.prod.webservices.mozgcp.net,prod.dap.prod.webservices.mozgcp.net,prod.data-ingestion.prod.dataops.mozgcp.net,prod.dataops.mozgcp.net,prod.experimenter.prod.webservices.mozgcp.net,prod.ingestion-edge.prod.dataops.mozgcp.net,prod.sentry.prod.cloudops.mozgcp.net,prod-classifyclient.normandy.prod.cloudops.mozgcp.net,profile.accounts.firefox.com,sdk.iad-05.braze.com,search.r53-2.services.mozilla.com,search.services.mozilla.com,self-repair.mozilla.org,self-repair.r53-2.services.mozilla.com,sentry.gitlab.net,sentry.io,sentry.nonprod.cloudops.mozgcp.net,sentry.prod.cloudops.mozgcp.net,sentry.prod.mozaws.net,sitereview.zscaler.com,snippets.allizom.org,snippets.cdn.mozilla.net,snippets.mozilla.com,snippets-prod.frankfurt.moz.works,snippets-prod.moz.works,snippets-prod.oregon-b.moz.works,snippets-stage.moz.works,snippets-stage.oregon-b.moz.works,snowplow.trx.gitlab.net,snowplowalb-1011729428.us-east-1.elb.amazonaws.com,snowplowprd.trx.gitlab.net,snowplowprdnlb-1490493263.us-east-2.elb.amazonaws.com,socorro.nonprod.webservices.mozgcp.net,socorro.prod.webservices.mozgcp.net,socorro-collector.services.mozilla.com,socorro-webapp-allizom.stage.mozaws.net,socorro-webapp.services.mozilla.com,spocs.getpocket.com,spocs.getpocket.dev,spocs.mozilla.net,ssl.google-analytics.com,ssl-google-analytics.l.google.com,stage.sentry.nonprod.cloudops.mozgcp.net,start.fedoraproject.org,start.thunderbird.net,start.ubuntu.com,start-stage.thunderbird.net,survey.mozilla.com,tagmanager.google.com,talkback.mozilla.org,talkback-public.mozilla.org,talkback-reports.mozilla.org,telemetry-coverage.mozilla.org,telemetry-coverage.r53-2.services.mozilla.com,telemetry-experiment.cdn.mozilla.net,telemetry-incoming.r53-2.services.mozilla.com,telemetry-incoming-a.r53-2.services.mozilla.com,telemetry-incoming-b.r53-2.services.mozilla.com,telemetry-prod-1054754349.us-east-1.elb.amazonaws.com,tiles-cdn.prod.ads.prod.webservices.mozgcp.net,updates.thunderbird.net,updates-stage.thunderbird.net,use-application-dns.net,vf.startpage.com,widgets.getpocket.com,www.250analytics.com,www.anonymco.com,www.google-analytics.com,www.google-analytics-cn.com,www.googleanalytics.com,www.googlesyndication.com,www.googlesyndication-cn.com,www.googletagmanager.com,www.googletagmanager-cn.com,www.googletagservices.com,www.googletagservices-cn.com,www.sentry.io,www-google-analytics.l.google.com,www-googletagmanager.l.google.com,0emn.com,0fmm.com,2mdn.net,2mdn-cn.net,ad-creatives-public.commondatastorage.googleapis.com,adgoogle.net,ads.google.cn,ads.google.com,adsbygoogle.com,adsensecustomsearchads.com,adsensecustomsearchads.org,adservice.google.com,adsgoogle.com,adstransparency.google.com,afs.googleusercontent.com,analytics.clients6.google.com,analytics.googleapis.com,analytics-alv.google.com,app-ads-services.com,app-analytics-services.com,app-analytics-services-att.com,app-measurement.com,app-measurement-cn.com,appsgrowthpromo-pa.googleapis.com,appsgrowthpromo-pa.clients6.google.com,badad.googleplex.com,clientmetrics-pa.googleapis.com,csi.gstatic.com,csi.l.google.com,csp.withgoogle.com,dai.google.com,displayads-formats.googleusercontent.com,doubleclick.cn,doubleclick.com,doubleclick.co.uk,doubleclick.de,doubleclick.google.com,doubleclick.host,doubleclick.ne.jp,doubleclick.net,doubleclick-cn.net,doubleclickbygoogle.com,doubleclicksearch.com,doubleclickusercontent.com,feedback-pa.clients6.google.com,feedback-pa.googleapis.com,footprints-pa.googleapis.com,gapromomanager-pa.googleapis.com,glsfrontend-pa.googleapis.com,google-syndicatedsearch.net,google-syndication.com,googleadapis.com,googleadapis.l.google.com,googleads.com,googleads.googleapis.com,googleads-cn.com,googleadservices.com,googleadservices-cn.com,googleadsserving.cn,googleoptimize.com,googleoptimize-cn.com,googletraveladservices.com,googletraveladservices-cn.com,googlevads-cn.com,growth-pa.googleapis.com,gvt2.com,gvt2-cn.com,gvt3.com,imasdk.googleapis.com,localservices.googleapis.com,merchant-center-analytics.goog,ogads-pa.clients6.google.com,ogads-pa.googleapis.com,optimize.google.com,pagead.l.google.com,pagead-googlehosted.l.google.com,pagead-tpc.l.google.com,pagead2.googlesyndication.com,pai.googlezip.net,partnerad.l.google.com,play.google.com,reach-pa.googleapis.com,s0-2mdn-net.l.google.com,scone-pa.clients6.google.com,scone-pa.googleapis.com,searchnotifications-pa.googleapis.com,searchpromo-pa.googleapis.com,static-doubleclick-net.l.google.com,syndicatedsearch.goog,tpc.googlesyndication.com,video-ad-creatives-public.commondatastorage.googleapis.com,www.adgoogle.net,www.adsbygoogle.com,www.adsensecustomsearchads.com,www.adsensecustomsearchads.org,www.adsgoogle.com,www.doubleclick.cn,www.doubleclick.com,www.doubleclick.co.uk,www.doubleclick.de,www.doubleclick.host,www.doubleclick.ne.jp,www.doubleclick.net,www.doubleclick-cn.net,www.doubleclickbygoogle.com,www.doubleclicksearch.com,www.doubleclickusercontent.com,www.googleadapis.com,www.googleads.com,www.googleads-cn.com,www.googleadservices.com,www.googleadservices-cn.com,www.googleadsserving.cn,www.googletraveladservices.com,www.googletraveladservices-cn.com,www.googlevads-cn.com,www.syndicatedsearch.goog,xgapromomanager-pa.googleapis.com,locationhistory-pa.googleapis.com,locationhistoryaggregates-pa.googleapis.com");

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

/*** 003 UNBREAK ***/

/// By default, allow Google Maps to:
// - Prompt to access geolocation
defaultPref("permissions.manager.defaultsUrl", "file:///etc/firefox/phoenix/resources/specs/google-maps/permissions"); // [LINUX-NON-FLATPAK-ONLY]
defaultPref("permissions.manager.defaultsUrl", "file:///app/etc/firefox/phoenix/resources/specs/google-maps/permissions"); // [FLATPAK-LINUX-ONLY]
defaultPref("permissions.manager.defaultsUrl", "file:///opt/homebrew/opt/phoenix-osx/resources/specs/google-maps/permissions"); // [SILICON-OSX-ONLY]
defaultPref("permissions.manager.defaultsUrl", "file:///usr/local/opt/phoenix-intel/resources/specs/google-maps/permissions"); // [INTEL-OSX-ONLY]
defaultPref("permissions.manager.defaultsUrl", "file:///C:/phoenix/resources/specs/google-maps/permissions"); // [WINDOWS-ONLY]

/// Expose the HTTPS network protocol
// Required to unbreak Google's CMP
defaultPref("network.protocol-handler.expose.https", true);

/// Re-enable geolocation
defaultPref("geo.provider.network.scan", true); // [DEFAULT]
defaultPref("geo.provider.network.url", "https://api.beacondb.net/v1/geolocate");
defaultPref("geo.provider.use_corelocation", true); // [DEFAULT]
defaultPref("geo.provider.use_geoclue", true); // [DEFAULT]
defaultPref("network.wifi.scanning_period", 60000); // [DEFAULT]

/// Re-enable Mozilla's remote FPP overrides to fix display issues with Google Maps
defaultPref("privacy.fingerprintingProtection.remoteOverrides.enabled", true); // [DEFAULT]

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

lockPref("browser.phoenix.status.specialized.google-maps", "successfully applied :D");
