I have an shortcut on several Windows PCs that points to Chrome with --proxy-pac-url.
Full Target: field in shortcut properties looks like this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-pac-url=file://C:/Local/Drive/Path/To/proxy.pacOne PC is always on and didn't restart Chrome in a long time. It still runs Chrome 71. On this PC .pac still works and I can access dynamically proxified resources. On the rest, where Chrome was updated to 72 and restarted it no longer works - Chrome tries to access resource directly and fails. Additionally, I can't debug it, since chrome://net-internals/#proxy shows is empty of any info save for re-apply/clear buttons.
So, what broke, how can I debug this and how to make a specific instance of Chrome run with specific .pac once again? Without always swapping options by hand, of course.
5 Answers
Chrome 72-75:
- As suggested in this bug report, you can disable 'Enable Network Service' in chrome://flags to go back to the old behaviour that supports file:// pac files. Starting Chrome from the command-line with
--disable-features=NetworkServicehas the same effect.
Chrome 76:
It seems that the 'Network Service' option has been removed from
chrome://flags(see the code commit).You can still run Chrome with
--disable-features=NetworkService(ref) (e.g./Applications/Google\ Chrome --disable-features=NetworkServiceon a Mac), and it seems to read the PAC file ok, though there might be some issues (because lots of related code seems to have been deleted already - see this issue - I guess YMMV, and this won't be a long-term solution.As suggested in the bug report, you are probably better either installing a browser plugin that lets you define PAC settings, or use an http(s) PAC file.
Chrome removed almost all functionality of net-internals for some reason and it sounds like they removed the pac flag that you were using.
chromium docs link to this site that still lists the flag as valid.
3I know this is an old thread but it still ranks high in Google search results.
I'm still successfully using a local .pac file with Chrome and Chromium 97 in Linux. I'm running Chrome with the following:
--proxy-pac-url='data:application/x-javascript-config;base64,'$(base64 -w0 /path/to/local/proxy.pac)This basically encodes the .pac file as base64 string and loads it as if it where some web response.
If you want to use this on Windows, see @TBGs answer
4Unfortunately, Chrome plans to remove --disable-features=NetworkService and support for file:/// PAC URLs entirely in the future.
Here's the upstream bug (and specifically the comment marking WONTFIX):
The solution that should work on Chrome 76+, without requiring an httpd, is to take the .zip file attached to that comment, unpack it somewhere permanent, and modify the bundled my_pac_script.js to be a symlink to your previous file:///... PAC file. Then install the extension in Chrome. It will load the PAC configuration when Chrome is started.
@jonny 's answer works like a charm ! (encoding proxy pac content to Base64)
However, if you're on Windows and have the same need, here's a small Powershell script you can use :
$proxyPacURL = "";
$proxyPacBytes = (Invoke-webrequest -URI $proxyPacURL).Content;
$proxyPacBase64 = [Convert]::ToBase64String($proxyPacBytes);
& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --proxy-pac-url='data:application/x-javascript-config;base64,'$proxyPacBase64;
stop-process -Id $PID;