title: Testing Proxy auto-config FindProxyForURL() via Javascript Console
body: <p>Is it possible to test a <a href="https://en.wikipedia.org/wiki/Proxy_auto-config" rel="nofollow noreferrer">Proxy auto-config (PAC) script</a> by manually executing the FindProxyForURL(url, host) function from the browser JavaScript console?</p>
  
  <p>Can the internal implementation of the <a href="http://findproxyforurl.com/pac-functions/" rel="nofollow noreferrer">PAC functions</a> (such as dnsDomainIs, shExpMatch, isInNet) be accessed from the console?</p>
  
  <p>Alternatively can these functions be implemented within standard JavaScript to allow the FindProxyForURL function to be executed manually? </p>
  
  <p>The only way I can find to <a href="http://findproxyforurl.com/debug-pac-file/" rel="nofollow noreferrer">debug the proxy.pac script</a> within the browser is to add alert() statements and let the browser execute it internally.  Being able to add  breakpoints and manually step through the FindProxyForURL function would make debugging it easier.</p>
  
  <p>There are many external tools for testing PAC scripts, such as <a href="https://github.com/pacparser/pacparser" rel="nofollow noreferrer">pacparser</a> (which uses Spidermonkey) and <a href="https://serverfault.com/questions/598535/how-can-i-debug-pac-proxy-auto-config-on-windows-8-1-ie11-and-modern-ui">autoprox</a> (which uses <a href="http://blogs.msdn.com/b/askie/archive/2014/02/07/optimizing-performance-with-automatic-proxyconfiguration-scripts-pac.aspx" rel="nofollow noreferrer">Microsofts implementation</a>)</p>
  
  <p>Similar questions have been asked:</p>
  
  <p><a href="https://stackoverflow.com/questions/3068728/how-to-discover-de-proxy-used-in-a-pac">How to discover de proxy used in a pac</a><br>
  <a href="https://stackoverflow.com/questions/14118472/how-to-get-access-log-of-pacproxy-auto-config">How to get access log of PAC(proxy auto config)</a><br>
  <a href="https://stackoverflow.com/questions/1033867/debugging-autoproxy-pac-javascript-with-alert">Debugging autoproxy (PAC) javascript with alert()?</a><br>
  <a href="https://stackoverflow.com/questions/1078793/where-in-windows-is-the-javascript-file-which-contains-functions-for-executing-p">Where in Windows is the Javascript file which contains functions for executing PAC files?</a>  </p>