DEV Community

Latz
Latz

Posted on

1 1

Firefox Addon: Add options menu to browser action icon

Especially during development it’s annoying to reach the option page of a Firefox addon:

  1. Hamburger
  2. Addons and Themes
  3. ...
  4. Options

There should be a faster way. At least for your own Add-ons you can quite easily add an “Options” menu item to the browser action:

browser.contextMenus.create({
    title: 'Options',
    contexts: ['browser_action'],
    onclick: () => {
      browser.runtime.openOptionsPage();
    },
  });
Enter fullscreen mode Exit fullscreen mode

Additionally to have to add a new permission to the manifest.json file:

"permissions": ["contextMenus"],
Enter fullscreen mode Exit fullscreen mode

menu

That was easy!

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay