Trigger
Last updated
Last updated
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 New Mod > Trigger.
Type the name in the Name field. This should be something that describes the mod.
In the Configuration section, enter the following information:
Field | Description |
---|---|
Trigger event | |
Debounce | 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. |
Sites | When you specify the sites that trigger the event, PixieBrix runs faster and more accurately. To do so, enter the URL in the Sites field. Make sure that at least one URL matches the pattern(s) you added. Learn more about What Are URL Match Patterns? 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 > Remove to remove a site from the list. |
Report Mode | 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. |
Optionally, you can Next, go to the Advanced: Match Rules section, and enter the following information:
This is optional information. In many cases, you may not need to configure any of these settings unless you're trying to do something specific.
Field | Description |
---|---|
URL Patterns | Click the Add URL Pattern button to add. 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. |
Selectors | 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.
Learn more about What Are URL Match Patterns?
Select an event that occurs to trigger or launch this mod. You can choose from any of the following events: You can also select a Custom Event. Learn more about Working with Custom Events.