Using Triggers, you can perform actions automatically when an event or change happens on a page. They can be helpful in many different contexts, such as responding to data changes, launching automated processes, or alerting support of potential problems. When configured correctly, event triggers are powerful tools for automation.
Follow these steps to create and configure a trigger.
- Open the PixieBrix Page Editor.
- In the left pane, click Add > Trigger.
- Type the name in the Extension Name field.
- In the Configuration section, enter the following information:
Select an event that occurs to trigger or launch this mod
To optimize performance, debouncing prevents trigger actions from running too quickly. You can toggle the Debounce button on or off to control how fast the browser responds.
When you specify the sites that trigger the event, PixieBrix runs faster and more accurately. To do so, enter the URL match pattern(s) in the Sites field. Make sure that at least one URL matches the pattern(s) you added. You can also: • Click the Site, Domain, HTTPS, or All URLs shortcuts to insert URLs automatically. • Click Add Site to enter a URL manually. • Click ABC Text > Remove to remove a site from the list.
Select the events/errors that report telemetry. • Select Report All to report all runs and errors. • Select Report First to only report the first run and first error.
- Next, go to the Advanced: Match Rules section, and enter the following information:
Click the Add URL Pattern button to add URL pattern matching rules. These rules restrict where the trigger runs. • hostname. Match a URL's hostname. • pathname. Matches the pathname part of a URL. • hash. Matching pattern for URL hashes. • search. Matches the search part of a URL. If you specify URLs, ensure that at least one URL matches the pattern(s) you added.
You can use selectors to restrict when the trigger runs. • To add a selector, click the Add Selector button, click the selector arrow, and then click on an area in the web page. The purple highlighted border indicates the selected area. • To remove a selector, click the $(...) drop-down, and then select Remove. If provided, ensure that at least one selector matches on page load. Otherwise, the extension will not run.
- URL match patterns determine which extensions run on a site or call an API. You can add URL match patterns in the Advanced: Extra Permissions section if the extension performs actions on a target tab not included in the site match patterns or if it calls an API without using an Integration. To do so:
- Click the Site, Domain, HTTPS, or All URLs shortcut to insert URLs automatically.
- Click ABC Text > Remove to remove a site from the list.