Developers wanting to add context menus to browser extensions face an all-or-nothing situation: context menu items, being global features, will be present on all pages once created. Adding a context menu item is easy, but if we want it to show only on certain Internet domains we will need to:
- keep an eye on the active tab
- check its domain whenever it changes
- show or hide the context menu depending on the domain of the page in the tab