An element appears on a page
Runs the macro when an element appears, disappears or changes on a page, such as a button, a banner or a price.
selector appears
Details #
Watches the page with a MutationObserver, installed only on pages whose address matches. selector finds the element (CSS, text=Sign in, role=button[name="Save"], or a >>> b through a shadow root).
on is appears (the default), disappears or changes (its text or attributes changed, settled for 300 ms). With text, the trigger fires only when the element's text contains that text, or matches /regex/. once stops watching after the first time on that page.
The run starts with the page's inputs plus selector, text, html and attributes of the element. {{triggerValue}} is its text.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
selector | text | Yes | What to watch for. Required. | |
match | record | browser title url | Which pages. url is a pattern (https://*.github.com/*/pull/*), a plain start (github.com/apple) or /regex/; title is text (any case) or /regex/; browser is safari, chrome or any. | |
on | one of | appears disappears changes | appears, disappears or changes. | |
once | yes / no | Stop after the first match on a page. | ||
text | text | Only when the element's text contains this, or matches /regex/. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
- “role=button[name="Add to cart"]” appears on a page on shop.example.com/*
- Show a notification “Back in stock”
Gotchas #
An element already on the page when it loads counts as appearing.
changesreports the element, not what changed; comparetextandattributesin the macro.