OLD | NEW |
1 <div id="pageData-name" class="pageData">Proxy Settings</div> | 1 <div id="pageData-name" class="pageData">Proxy Settings</div> |
2 | 2 |
3 <!-- BEGIN AUTHORED CONTENT --> | 3 <!-- BEGIN AUTHORED CONTENT --> |
4 <p id="classSummary"> | 4 <p id="classSummary"> |
5 Use the <code>chrome.experimental.proxysettings</code> module to manage Chrome's | 5 Use the <code>chrome.experimental.proxysettings</code> module to manage Chrome's |
6 proxy settings. This module is still experimental. For information on how to use | 6 proxy settings. This module is still experimental. For information on how to use |
7 experimental APIs, see the <a href="experimental.html">chrome.experimental.* | 7 experimental APIs, see the <a href="experimental.html">chrome.experimental.* |
8 APIs</a> page. | 8 APIs</a> page. |
9 </p> | 9 </p> |
10 | 10 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 mode: "fixed_servers", | 211 mode: "fixed_servers", |
212 rules: { | 212 rules: { |
213 httpProxy: { | 213 httpProxy: { |
214 scheme: "socks5", | 214 scheme: "socks5", |
215 host: "1.2.3.4" | 215 host: "1.2.3.4" |
216 }, | 216 }, |
217 bypassList: ["foobar.com"] | 217 bypassList: ["foobar.com"] |
218 } | 218 } |
219 }; | 219 }; |
220 chrome.experimental.proxy.settings.set( | 220 chrome.experimental.proxy.settings.set( |
221 {'value': config, 'incognito': false}, | 221 {value: config, scope: 'regular'}, |
222 function() {}); | 222 function() {}); |
223 </pre> | 223 </pre> |
224 | 224 |
225 <p> | 225 <p> |
226 The following code sets a custom pac script. | 226 The following code sets a custom pac script. |
227 </p> | 227 </p> |
228 | 228 |
229 <pre> | 229 <pre> |
230 var config = { | 230 var config = { |
231 mode: "pac_script", | 231 mode: "pac_script", |
232 pacScript: { | 232 pacScript: { |
233 data: "function FindProxyForURL(url, host) {\n" + | 233 data: "function FindProxyForURL(url, host) {\n" + |
234 " if (host == 'foobar.com')\n" + | 234 " if (host == 'foobar.com')\n" + |
235 " return 'PROXY blackhole:80';\n" + | 235 " return 'PROXY blackhole:80';\n" + |
236 " return 'DIRECT';\n" + | 236 " return 'DIRECT';\n" + |
237 "}" | 237 "}" |
238 } | 238 } |
239 }; | 239 }; |
240 chrome.experimental.proxy.settings.set( | 240 chrome.experimental.proxy.settings.set( |
241 {'value': config, 'incognito': false}, | 241 {value: config, scope: 'regular'}, |
242 function() {}); | 242 function() {}); |
243 </pre> | 243 </pre> |
244 | 244 |
245 <p> | 245 <p> |
246 The next snippet queries the current proxy settings. | 246 The next snippet queries the current proxy settings. |
247 </p> | 247 </p> |
248 | 248 |
249 <pre> | 249 <pre> |
250 chrome.experimental.proxy.settings.get( | 250 chrome.experimental.proxy.settings.get( |
251 {'incognito': false}, | 251 {'incognito': false}, |
252 function(config) {console.log(JSON.stringify(config));}); | 252 function(config) {console.log(JSON.stringify(config));}); |
253 </pre> | 253 </pre> |
254 | 254 |
255 <p> | 255 <p> |
256 Note that the <code>value</code> object passed to <code>set()</code> is not | 256 Note that the <code>value</code> object passed to <code>set()</code> is not |
257 identical to the <code>value</code> object passed to callback function of | 257 identical to the <code>value</code> object passed to callback function of |
258 <code>get()</code>. The latter will contain a <code>rules.httpProxy.port</code> | 258 <code>get()</code>. The latter will contain a <code>rules.httpProxy.port</code> |
259 element. | 259 element. |
260 </p> | 260 </p> |
261 | 261 |
262 <!-- END AUTHORED CONTENT --> | 262 <!-- END AUTHORED CONTENT --> |
OLD | NEW |