alert()
Debug output from a PAC. Where it goes depends on the engine; remove it from production files.
alert(message) → undefinedNot 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
| Engine | Behaviour | Source |
|---|---|---|
| chromium | Forwarded to the net log (chrome://net-export). | code, verified 2026-10-04 |
| firefox | Written to the browser console as "PAC-alert: ...". | code, verified 2026-10-04 |
| pacparser | 1.5.1 and newer print to stderr. | code, verified 2026-10-04 |
| pacparser | 1.5.0 and older have no alert(), so calling it throws ReferenceError. | doc, unverified |
Availability
| Function | chromium | chromium | firefox | pacparser | pacparser | pacparser | reference |
|---|---|---|---|---|---|---|---|
alert | yes | yes | yes | no | no | yes | yes |
Related rules
- alert() used in the PAC PAC-K002