icecat-preferences.patch (9693B) - View raw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252diff --git a/browser/base/content/appmenu-viewcache.inc.xhtml b/browser/base/content/appmenu-viewcache.inc.xhtml index ec44a3b1a354..e469b754d93d 100644 --- a/browser/base/content/appmenu-viewcache.inc.xhtml +++ b/browser/base/content/appmenu-viewcache.inc.xhtml @@ -139,6 +139,9 @@ key="key_preferencesCmdMac" #endif /> + <toolbarbutton id="appMenu-icecatsettings-button" + class="subviewbutton" + data-l10n-id="appmenuitem-icecat-settings"/> <toolbarbutton id="appMenu-more-button2" class="subviewbutton subviewbutton-nav" data-l10n-id="appmenuitem-more-tools" diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index 01bca4ecb0de..7c755439d1d5 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -116,6 +116,8 @@ /> #endif #endif + <menuitem id="menu_icecat_preferences" + data-l10n-id="appmenuitem-icecat-settings"/> </menupopup> </menu> diff --git a/browser/base/content/browser-menubar.js b/browser/base/content/browser-menubar.js index 61ae54a0884c..6d4c315427bc 100644 --- a/browser/base/content/browser-menubar.js +++ b/browser/base/content/browser-menubar.js @@ -16,6 +16,9 @@ document.addEventListener( case "menu_preferences": openPreferences(undefined); break; + case "menu_icecat_preferences": + openPreferences("privacy-icecatPreferences"); + break; // == view-menu == case "menu_pageStyleNoStyle": diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index 689205034d9d..a80bbcfe2926 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -379,6 +379,9 @@ const PanelUI = { case "appMenu-settings-button": openPreferences(); break; + case "appMenu-icecatsettings-button": + openPreferences("privacy-icecatPreferences"); + break; case "appMenu-more-button2": this.showMoreToolsPanel(target); break; diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml index 28e325c938de..fb7e669e07f6 100644 --- a/browser/components/preferences/privacy.inc.xhtml +++ b/browser/components/preferences/privacy.inc.xhtml @@ -691,6 +691,83 @@ </hbox> </groupbox> +<!-- IceCat-specific privacy group --> +<groupbox id="iceCatPrivacyGroup" + data-category="panePrivacy" data-subcategory="icecatPreferences" + hidden="true"> + <label><html:h2 data-l10n-id="icecat-privacy-group-header"/></label> + <vbox> + <checkbox id="disableJavaScript" data-l10n-id="disable-javascript-option" + preference="javascript.enabled"/> + <vbox class="indent"> + <label data-l10n-id="disable-javascript-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="disableCustomFonts" data-l10n-id="disable-custom-fonts-option" + preference="browser.display.use_document_fonts"/> + <vbox class="indent"> + <label data-l10n-id="disable-custom-fonts-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="isolateRequestFirstParty" data-l10n-id="isolate-request-first-party-option" + preference="privacy.firstparty.isolate"/> + <vbox class="indent"> + <label data-l10n-id="isolate-request-first-party-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="autoUpdateExtensions" data-l10n-id="auto-update-extensions-option" + preference="extensions.update.enabled"/> + <vbox class="indent"> + <label data-l10n-id="auto-update-extensions-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="spoofReferrers" data-l10n-id="spoof-referers-option" + preference="network.http.referer.spoofSource"/> + <vbox class="indent"> + <label data-l10n-id="spoof-referers-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="resistFingerprinting" data-l10n-id="resist-fingerprinting-option" + preference="privacy.resistFingerprinting"/> + <vbox class="indent"> + <label data-l10n-id="resist-fingerprinting-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="detectCaptivePortal" data-l10n-id="detect-captive-portal-option" + preference="network.captive-portal-service.enabled"/> + <vbox class="indent"> + <label data-l10n-id="detect-captive-portal-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="detectNetworkConnectivity" data-l10n-id="detect-network-connectivity-option" + preference="network.connectivity-service.enabled"/> + <vbox class="indent"> + <label data-l10n-id="detect-network-connectivity-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="geolocation" data-l10n-id="geolocation-option" + preference="browser.search.geoip.url"/> + <vbox class="indent"> + <label data-l10n-id="geolocation-description"/> + </vbox> + </vbox> + <vbox> + <checkbox id="webgl" data-l10n-id="webgl-option" + preference="webgl.disabled"/> + <vbox class="indent"> + <label data-l10n-id="webgl-description"/> + </vbox> + </vbox> +</groupbox> + <hbox id="permissionsCategory" class="subcategory" hidden="true" diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js index 5722057a0665..3d825f40fa3b 100644 --- a/browser/components/preferences/privacy.js +++ b/browser/components/preferences/privacy.js @@ -156,6 +156,16 @@ Preferences.addAll([ { id: "browser.urlbar.suggest.quicksuggest.sponsored", type: "bool" }, { id: "browser.urlbar.quicksuggest.dataCollection.enabled", type: "bool" }, + // IceCat-specific + { id: "javascript.enabled", type: "bool" }, + { id: "browser.display.use_document_fonts", type: "int" }, + { id: "extensions.update.enabled", type: "bool" }, + { id: "network.http.referer.spoofSource", type: "bool" }, + { id: "webgl.disabled", type: "bool" }, + { id: "network.captive-portal-service.enabled", type: "bool" }, + { id: "network.connectivity-service.enabled", type: "bool" }, + { id: "browser.search.geoip.url", type: "string" }, + // History { id: "places.history.enabled", type: "bool" }, { id: "browser.formfill.enable", type: "bool" }, @@ -1150,6 +1160,24 @@ var gPrivacyPane = { setSyncFromPrefListener("enableOCSP", () => this.readEnableOCSP()); setSyncToPrefListener("enableOCSP", () => this.writeEnableOCSP()); + setSyncFromPrefListener("disableJavaScript", () => this.readDisableJavaScript()); + setSyncToPrefListener("disableJavaScript", () => this.writeDisableJavaScript()); + + setSyncFromPrefListener("disableCustomFonts", () => this.readDisableCustomFonts()); + setSyncToPrefListener("disableCustomFonts", () => this.writeDisableCustomFonts()); + + setSyncFromPrefListener("detectCaptivePortal", () => this.readDetectCaptive()); + setSyncToPrefListener("detectCaptivePortal", () => this.writeDetectCaptive()); + + setSyncFromPrefListener("detectNetworkConnectivity", () => this.readDetectConnectivity()); + setSyncToPrefListener("detectNetworkConnectivity", () => this.writeDetectConnectivity()); + + setSyncFromPrefListener("geolocation", () => this.readGeolocation()); + setSyncToPrefListener("geolocation", () => this.writeGeolocation()); + + setSyncFromPrefListener("webgl", () => this.readWebGL()); + setSyncToPrefListener("webgl", () => this.writeWebGL()); + if (AlertsServiceDND) { let notificationsDoNotDisturbBox = document.getElementById( "notificationsDoNotDisturbBox" @@ -1259,6 +1287,62 @@ var gPrivacyPane = { SiteDataManager.updateSites(); }, + // ICECAT PREFERENCES + + readDisableJavaScript() { + let pref = Preferences.get("javascript.enabled"); + return !pref.value; + }, + writeDisableJavaScript() { + let checkbox = document.getElementById("disableJavaScript"); + return !checkbox.checked; + }, + + readDisableCustomFonts() { + let pref = Preferences.get("browser.display.use_document_fonts"); + return pref.value == 0; + }, + writeDisableCustomFonts() { + let checkbox = document.getElementById("disableCustomFonts"); + return checkbox.checked ? 0 : 1; + }, + + readDetectCaptive() { + let pref = Preferences.get("network.captive-portal-service.enabled"); + return pref.value; + }, + writeDetectCaptive() { + let checkbox = document.getElementById("detectCaptivePortal"); + return checkbox.checked; + }, + + readDetectConnectivity() { + let pref = Preferences.get("network.connectivity-service.enabled"); + return pref.value; + }, + writeDetectConnectivity() { + let checkbox = document.getElementById("detectNetworkConnectivity"); + return checkbox.checked; + }, + + readGeolocation() { + let pref = Preferences.get("browser.search.geoip.url"); + return pref.value !== ""; + }, + writeGeolocation() { + let checkbox = document.getElementById("geolocation"); + return checkbox.checked ? "https://location.services.mozilla.com/v1/country?key=%MOZILLA_API_KEY%" : ""; + }, + + readWebGL() { + let pref = Preferences.get("webgl.disabled"); + return !pref.value; + }, + writeWebGL() { + let checkbox = document.getElementById("webgl"); + return !checkbox.checked; + }, + // CONTENT BLOCKING /**