pac - Testing Proxy auto-config FindProxyForURL() via Javascript Console -


is possible test proxy auto-config (pac) script manually executing findproxyforurl(url, host) function browser javascript console?

can internal implementation of pac functions (such dnsdomainis, shexpmatch, isinnet) accessed console?

alternatively can these functions implemented within standard javascript allow findproxyforurl function executed manually?

the way can find debug proxy.pac script within browser add alert() statements , let browser execute internally. being able add breakpoints , manually step through findproxyforurl function make debugging easier.

there many external tools testing pac scripts, such pacparser (which uses spidermonkey) , autoprox (which uses microsofts implementation)

similar questions have been asked:

how discover de proxy used in pac
how access log of pac(proxy auto config)
debugging autoproxy (pac) javascript alert()?
where in windows javascript file contains functions executing pac files?

some of pac functions have been implemented pactester , available in pac_utils.js: https://github.com/manugarg/pactester/blob/master/pac_utils.js

however missing functions dnsresolve , myipaddress noted in pactester readme:

pac files use javascript functions. these functions have been defined in pac_utils.js file included tool (this file generated using file mozilla source code). also, since javascript has no dns resolving capability required "dnsresolve" , "myipaddress" functions in pac files, these functions have been defined in perl , exported javascript context.

there implementations of these functions using web services won't work local addresses without running own server:

dnsresolve:
can perform dns lookup (hostname ip address) using client-side javascript?
perform dns lookup resolve hostname ip address using javascript

myipaddress:
how client's ip address using javascript only?

i don't know if it's possible make browsers grant access manually execute scripts within pac sandbox environment hosts native implementation of these functions.

pac files run in browser sandbox don’t have access entire javascript programming language. instead, pac file functionality implemented in browser custom sanboxed function set.


Comments