- Setting PAC Scripts
1.1-3. Windows, Chromium, FireFox - Caching of PAC Scripts
2.1-3. Windows, Chromium, FireFox - Developing PAC Scripts
3.1. Alerts and Debugging
3.2. Chromium Bugs/Features
3.3. Implementations and Sources
3.4. Resources
On Windows you may set PAC script via Win+R > inetcpl.cpl > Connections > LAN settings > Use automatic configuration script
- In Chromium settings there is a button for opening standard Linux/Windows dialog of setting PAC script.
- Also Web Extensions of Chromium may set PAC script as a string and as URL via
chrome.proxy.settings
. This is implemented independently of the OS and has its own bugs.
Browser > Options > Advanced > Network > Settings > Automatic proxy configuration URL
Windows (winHttp, etc.) does very poor caching if any. Setting PAC script via URL in system settings results in server bombardment with requests.
If web extension set PAC script via URL then the script is loaded only once and cached. Cache overloading happens only on browser restarts. (checked on Chrome 55/Windows)
After setting PAC URL in browser settings it is loaded only once or twice and cached for a long period. (checked on Firefox 50/Windows)
PAC script is re-evaluated (and reparsed) each time for each URL-resource loaded.- There are no
window
,global
,setTimeout/setInterval
global variables. There isMath
however. - IE may be detected via Conditional Compilation of comment content:
const isIE = /*@cc_on!@*/false;
. I haven't tested this. - 'google.com.' with dot at the end is also a correct notation. I don't know any library that passes
host
this way, but I always defense myself with:host.replace(/\.?$/, '')
.
- Alert messages may be seen in Chromium network events: chrome://net-internals/#events
- In Chromium you may check active proxy settings via chrome://net-internals/#proxy
- In Chromium you may add PAC script's error listener via
chrome.proxy.onProxyError.addListener
and pass debug information in error.
- Web Extensions can't set PAC scripts larger than 1MB via URL, bug.
- Web Extensions can't set scripts as a string with non-ASCII chars, unicode URLs must be punycoded.
- Once I deleted all extensions from Chrome, but PAC script was still active and couldn't be purged via settings or browser restarts.