A page expression is true
Passes when a JavaScript expression evaluated in the page is truthy.
A page expression script is true
Details #
Evaluates script in the page (in world main, the page's own objects, by default) and passes when the result is truthy. It needs Allow User Scripts for Switchboard in Chrome; without that the condition fails and says so.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
script | text | Yes | A JavaScript expression. Required. | |
sample | any value | |||
tab | any value | Which tab. | ||
world | one of | main isolated | main (default) or isolated. |
Examples #
Only when the user is signed in
Only if
- If the page expression “!!document.querySelector('.avatar')” is true
Do
- Show “Signed in” for 1 s
Gotchas #
It runs the expression in the page for real, so keep it free of side effects.