summaryrefslogtreecommitdiff
path: root/data/patches/icecat-preferences.patch
blob: 1d5f655ed671a073a44726c81344534fbbfada02 (plain)
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
--- a/browser/components/preferences/privacy.inc.xhtml.orig	2021-08-17 15:38:19.838881866 -0400
+++ b/browser/components/preferences/privacy.inc.xhtml	2021-08-17 15:39:01.382760058 -0400
@@ -632,6 +632,83 @@
          data-l10n-id="addressbar-suggestions-settings"/>
 </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"
--- a/browser/components/preferences/privacy.js.orig	2021-08-17 15:39:19.662709308 -0400
+++ b/browser/components/preferences/privacy.js	2021-08-17 16:10:17.129079115 -0400
@@ -138,6 +138,17 @@
   { id: "browser.urlbar.suggest.topsites", type: "bool" },
   { id: "browser.urlbar.suggest.engines", 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: "privacy.resistFingerprinting", 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" },
@@ -706,6 +716,24 @@
     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"
@@ -825,6 +850,62 @@
     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
 
   /**
diff -ru icecat-91.13.0/browser/base/content/appmenu-viewcache.inc.xhtml icecat-91.13.0.orig/browser/base/content/appmenu-viewcache.inc.xhtml
--- icecat-91.13.0/browser/base/content/appmenu-viewcache.inc.xhtml	2022-08-30 20:57:37.511721105 -0400
+++ icecat-91.13.0.orig/browser/base/content/appmenu-viewcache.inc.xhtml	2022-08-30 20:52:39.076545425 -0400
@@ -336,6 +336,10 @@
                      key="key_preferencesCmdMac"
 #endif
                      oncommand="openPreferences()"/>
+      <toolbarbutton id="appMenu-icecatsettings-button"
+                     class="subviewbutton"
+                     data-l10n-id="appmenuitem-icecat-settings"
+                     oncommand="switchToTabHavingURI('about:preferences#privacy-icecatPreferences', true)"/>
       <toolbarbutton id="appMenu-more-button2"
                      class="subviewbutton subviewbutton-nav"
                      data-l10n-id="appmenuitem-more-tools"
diff -ru icecat-91.13.0.orig/browser/base/content/browser-menubar.inc icecat-91.13.0/browser/base/content/browser-menubar.inc
--- icecat-91.13.0.orig/browser/base/content/browser-menubar.inc	2022-08-30 21:06:25.143226477 -0400
+++ icecat-91.13.0/browser/base/content/browser-menubar.inc	2022-08-30 21:06:10.103469430 -0400
@@ -139,6 +139,9 @@
                           />
 #endif
 #endif
+              <menuitem id="menu_icecat_preferences"
+	          oncommand="switchToTabHavingURI('about:preferences#privacy-icecatPreferences', true)"
+	          data-l10n-id="appmenuitem-icecat-settings"/>
               </menupopup>
             </menu>