|
5 | 5 | const lazy = {};
|
6 | 6 |
|
7 | 7 | ChromeUtils.defineESModuleGetters(lazy, {
|
8 |
| - Preferences: "resource://gre/modules/Preferences.sys.mjs", |
9 |
| - |
10 | 8 | AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
11 | 9 | assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
12 | 10 | error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
@@ -146,64 +144,70 @@ export class Proxy {
|
146 | 144 | init() {
|
147 | 145 | switch (this.proxyType) {
|
148 | 146 | case "autodetect":
|
149 |
| - lazy.Preferences.set("network.proxy.type", 4); |
| 147 | + Services.prefs.setIntPref("network.proxy.type", 4); |
150 | 148 | return true;
|
151 | 149 |
|
152 | 150 | case "direct":
|
153 |
| - lazy.Preferences.set("network.proxy.type", 0); |
| 151 | + Services.prefs.setIntPref("network.proxy.type", 0); |
154 | 152 | return true;
|
155 | 153 |
|
156 | 154 | case "manual":
|
157 |
| - lazy.Preferences.set("network.proxy.type", 1); |
| 155 | + Services.prefs.setIntPref("network.proxy.type", 1); |
158 | 156 |
|
159 | 157 | if (this.httpProxy) {
|
160 |
| - lazy.Preferences.set("network.proxy.http", this.httpProxy); |
| 158 | + Services.prefs.setStringPref("network.proxy.http", this.httpProxy); |
161 | 159 | if (Number.isInteger(this.httpProxyPort)) {
|
162 |
| - lazy.Preferences.set("network.proxy.http_port", this.httpProxyPort); |
| 160 | + Services.prefs.setIntPref( |
| 161 | + "network.proxy.http_port", |
| 162 | + this.httpProxyPort |
| 163 | + ); |
163 | 164 | }
|
164 | 165 | }
|
165 | 166 |
|
166 | 167 | if (this.sslProxy) {
|
167 |
| - lazy.Preferences.set("network.proxy.ssl", this.sslProxy); |
| 168 | + Services.prefs.setStringPref("network.proxy.ssl", this.sslProxy); |
168 | 169 | if (Number.isInteger(this.sslProxyPort)) {
|
169 |
| - lazy.Preferences.set("network.proxy.ssl_port", this.sslProxyPort); |
| 170 | + Services.prefs.setIntPref( |
| 171 | + "network.proxy.ssl_port", |
| 172 | + this.sslProxyPort |
| 173 | + ); |
170 | 174 | }
|
171 | 175 | }
|
172 | 176 |
|
173 | 177 | if (this.socksProxy) {
|
174 |
| - lazy.Preferences.set("network.proxy.socks", this.socksProxy); |
| 178 | + Services.prefs.setStringPref("network.proxy.socks", this.socksProxy); |
175 | 179 | if (Number.isInteger(this.socksProxyPort)) {
|
176 |
| - lazy.Preferences.set( |
| 180 | + Services.prefs.setIntPref( |
177 | 181 | "network.proxy.socks_port",
|
178 | 182 | this.socksProxyPort
|
179 | 183 | );
|
180 | 184 | }
|
181 | 185 | if (this.socksVersion) {
|
182 |
| - lazy.Preferences.set( |
| 186 | + Services.prefs.setIntPref( |
183 | 187 | "network.proxy.socks_version",
|
184 | 188 | this.socksVersion
|
185 | 189 | );
|
186 | 190 | }
|
187 | 191 | }
|
188 | 192 |
|
189 | 193 | if (this.noProxy) {
|
190 |
| - lazy.Preferences.set( |
| 194 | + Services.prefs.setStringPref( |
191 | 195 | "network.proxy.no_proxies_on",
|
192 | 196 | this.noProxy.join(", ")
|
193 | 197 | );
|
194 | 198 | }
|
195 | 199 | return true;
|
196 | 200 |
|
197 | 201 | case "pac":
|
198 |
| - lazy.Preferences.set("network.proxy.type", 2); |
199 |
| - lazy.Preferences.set( |
| 202 | + Services.prefs.setIntPref("network.proxy.type", 2); |
| 203 | + Services.prefs.setStringPref( |
200 | 204 | "network.proxy.autoconfig_url",
|
201 | 205 | this.proxyAutoconfigUrl
|
202 | 206 | );
|
203 | 207 | return true;
|
204 | 208 |
|
205 | 209 | case "system":
|
206 |
| - lazy.Preferences.set("network.proxy.type", 5); |
| 210 | + Services.prefs.setIntPref("network.proxy.type", 5); |
207 | 211 | return true;
|
208 | 212 |
|
209 | 213 | default:
|
|
0 commit comments