The Context Menu action allows you to add items to your browser’s context menu. The menu item will appear when you right-click on a web page or in certain contexts. Similar to buttons, you can add bricks to automate many common or complex actions to make any web page more powerful.
Follow these steps to create and configure a new Context Menu item:
- Open the PixieBrix Page Editor.
- In the left pane, click Add > Context Menu.
- Go to the PixieBrix Page Editor, and edit a name in the Extension Name field if desired.
- In the section, enter the following information:
Field | Description |
Title | If desired, edit the default context menu name. This is the name that displays in the context menu options.
Alternatively, you can click on the selected text shortcut link to insert the %s placeholder automatically. For example, if a user selects "Amazon" on a page, the browser automatically inserts "Amazon" in the context menu. |
Menu context | Specify when the context menu item should display by selecting the appropriate context:
• page - Excludes links, frames, images, and selected text.
• all - Displays in all contexts, meaning that it always displays.
• frame - Displays the menu item on frames (e.g., iframes within a page)
• selection - Displays the menu item when right-clicking on selected text.
• link - Displays the menu item when right-clicking on a link.
• image - Displays the menu item when right-clicking on an image. |
Sites | When you specify the sites you want the context menu to display, 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 add more sites.
• Click ABC Text > Remove to remove a site from the list. |
- Next, go to the Advanced section and enter the following information.
Field | Description |
Target Mode | • Select eventTarget to provide the Context Menu element clicked as the source of the action.
• Select document to provide the entire HTML document as the source of the action.
• Legacy. This option is deprecated. Do not select this option. |
Automatic Permissions | Add the URL location(s) where the context menu items should display.
• Click the Site, Domain, HTTPS, or All URLs shortcut to insert URLs automatically.
• Click Add Site to add more sites. In most cases, users display the context menu item on one site, but you can enter more than one URL to display it on multiple sites.
• Click ABC Text > Remove to remove a site from the list.
PixieBrix runs faster and more accurately when you specify URLs in the action, but make sure that at least one URL matches the pattern(s) you added. |
- 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 Add Allowed Origin button in the Sites/APIs:
- Click the Site, Domain, HTTPS, or All URLs shortcut to insert URLs automatically.