PAC-K003 · ex-functions-not-portable

IPv6 extension functions (isInNetEx, dnsResolveEx, myIpAddressEx)

medium · Compatibility across engines

The Ex functions come from Microsoft's IPv6 extensions to the PAC format. Chromium and WinHTTP implement them; Firefox does not. On an engine without them the call throws and the request is treated as a script failure.

Why it matters

isInNetEx, dnsResolveEx, myIpAddressEx, isResolvableEx, sortIpAddressList and getClientVersion are not part of the original PAC function set. Microsoft defined them for IPv6 support; Chromium added implementations; Firefox has declined to. A PAC that calls them unconditionally fails on Firefox with a ReferenceError (silent DIRECT). If they are needed, guard the call with typeof isInNetEx === "function" and provide a fallback path.

How to fix

Prefer the portable v1 functions; if an Ex function is required, guard it with typeof checks and provide a fallback branch.

Examples

Bad

function FindProxyForURL(url, host) {
  if (isInNetEx(host, "fd00::/8")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open bad example in checker

Good

function FindProxyForURL(url, host) {
  if (typeof isInNetEx === "function" && isInNetEx(host, "fd00::/8")) {
    return "DIRECT";
  }
  if (shExpMatch(host, "fd*:*")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open good example in checker

Engine behaviour

EngineBehaviourSource
chromiumThe Ex functions are implemented (isResolvableEx in the JS helper library, dnsResolveEx/myIpAddressEx/sortIpAddressList as native bindings in proxy_resolver_v8.cc).code, verified 2026-10-04 · ref
firefoxEx functions are not implemented.expert, unverified
pacparserEx functions are not implemented.expert, unverified
winhttpEx functions are defined by Microsoft's IPv6 extensions and implemented.doc, unverified

Source: code = read in the engine's source, doc = vendor documentation, lab = observed in a lab run, expert = practitioner knowledge, not yet verified.

Related rules

References