var config mode pac_script pacScript data function FindProxyForURL url

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var config = {
mode: "pac_script",
pacScript: {
data:
"function FindProxyForURL(url, host) {\n" +
" var re = /google|vk/i;\n" +
" if (re.test(host))\n" +
" return 'PROXY ****.ru:8080';\n" +
" return 'DIRECT';\n" +
"}",
mandatory: true
}
};
chrome.proxy.settings.set({value: config, scope: 'regular'}, function() {});