Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
selectortextYesWhat to watch for. Required.
matchrecordbrowser title urlWhich 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.
onone ofappears disappears changesappears, disappears or changes.
onceyes / noStop after the first match on a page.
texttextOnly 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 #

Tell me when the Add to cart button appears
When
  1. “role=button[name="Add to cart"]” appears on a page on shop.example.com/*
Do
  1. Show a notification “Back in stock”
Open in Switchboard to try it

Gotchas #

  • An element already on the page when it loads counts as appearing.

  • changes reports the element, not what changed; compare text and attributes in the macro.