9

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.pac

One 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.

3

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=NetworkService has 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.app/Contents/MacOS/Google\ Chrome --disable-features=NetworkService on 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.

| improve this answer | |
  • 2
    Note that even --disable-features=NetworkService is only a temporary fix; from the linked bug, "we will not be supporting file:// URLs when the Network Service is enabled, and will be deprecating support completely in the future." – Conrad Meyer Oct 1 '19 at 23:21
7

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.

https://peter.sh/experiments/chromium-command-line-switches/

| improve this answer | |
  • 6
    Here's the related Chromium issue where file:// PAC files were removed: bugs.chromium.org/p/chromium/issues/… – paulcm Feb 18 '19 at 12:45
  • 6
    Also, as suggested in the bug, you can also disable 'Enable Network Service' in chrome://flags to go back to the old behaviour that supports file:// pac files, though that will also be removed in future. Starting Chrome like /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=NetworkService has the same effect. – paulcm Feb 18 '19 at 14:05
  • 2
    @paulcm that should be an answer. – Oleg V. Volkov Feb 18 '19 at 15:32
0

Unfortunately, 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): https://bugs.chromium.org/p/chromium/issues/detail?id=839566#c40

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.

| improve this answer | |
-1

I 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 86 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.

Maybe there exists something similar for Windows.

| improve this answer | |
New contributor
jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.