Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This method was deprecated in Firefox 68 and removed in Firefox 71. In Firefox 68–70, calling this method logs an error message to the console:
Registers a Proxy Auto-Configuration (PAC) file. The file is executed immediately, and its FindProxyForURL()
function will be called for any HTTP or HTTPS requests.
If PAC files are registered by more than one extension, then requests will be passed initially to the one that was registered first.
- If the
FindProxyForURL()
function in the first PAC returns "DIRECT" for a request, then the request will be passed unchanged to theFindProxyForURL()
function in the next PAC. - If the
FindProxyForURL()
function in the first PAC proxies the request by returning "PROXY" or some other proxying value, then the proxy URL will be passed to theFindProxyForURL()
function in the next PAC.
Each extension can only register a single PAC file: if you call register()
twice, the second PAC file will replace the first.
This is an asynchronous function that returns a Promise
.