//

//
// 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");
