As many people know, Chrome (and other browser based on Chromium, at least Brave and Edge) still rely on the desktop’s proxy settings on Linux (I remember writing about this back in 2011).
Under normal circumstances, it is as easy as running the program with
--proxy-pac-url commandline switch, like so:
$ brave --proxy-pac-url="https://example.com/proxy.pac"
But what if you want to use a local file?
At some point (around Chrome 77 it seems), Chrome stopped accepting file:// URLs for
This will encode the file with base64 and load it as if it is a web respsonse.
A simple script to launch the browser (Brave in this case) with the correct paramters: