alert()

Debug output from a PAC. Where it goes depends on the engine; remove it from production files.

alert(message)  →  undefined

Used in about 2% of the real PAC files in the PAC file statistics.

Not part of the original Netscape API. Engines log it somewhere (or not at all), and an engine without it throws a ReferenceError, which turns the whole evaluation into an error.

Example

alert("PAC evaluated for " + host); // remove before deploying

Engine notes

EngineBehaviourSource
chromiumForwarded to the net log (chrome://net-export).code, verified 2026-10-04
services/proxy_resolver/proxy_resolver_v8.cc AlertCallback
firefoxWritten to the browser console as "PAC-alert: ...".code, verified 2026-10-04
netwerk/base/ProxyAutoConfig.cpp@3f73c528 PACProxyAlert
pacparser1.5.1 and newer print to stderr.code, verified 2026-10-04
src/pacparser.c@v1.5.3 pac_alert
pacparser1.5.0 and older have no alert(), so calling it throws ReferenceError.doc, unverified
pacparser 1.5.1 release notes
winhttpExists and returns false, with or without arguments; the script continues.lab, verified 2026-10-11
Windows 11 25H2

Availability

Derived from each engine's vendored helper library plus its native bindings (see engines).
Functionchromium
<=51
chromium
>=52
firefox
all
pacparser
<=1.4.6
pacparser
>=1.5.1
winhttp
11-25H2
wininet
11-25H2
reference
all
alertyesyesyesnoyesyesyesyes

Related rules

Last updated: