0Pricing
Browser Extensions Development (Chrome & Edge) · Lesson

Adding Context Menu Items

Create custom context menu items that appear when users right-click on web pages, images, or links, triggering extension actions.

What are Context Menus?

Browser extensions can add custom items to the context menu, which appears when you right-click on a web page.

These items let users perform quick actions related to what they clicked on, like saving an image, translating selected text, or triggering a custom search.

Enabling Context Menus

Before your extension can create context menu items, you need to declare the "contextMenus" permission in your manifest.json file.

This permission tells the browser your extension intends to interact with the context menu API.

{ "manifest_version": 3,
  "name": "My Menu Extension",
  "version": "1.0",
  "permissions": [
    "contextMenus"
  ],
  "background": {
    "service_worker": "background.js"
  }
}

All lessons in this course

  1. Adding Context Menu Items
  2. Omnibox Keyword Integration
  3. Responding to Omnibox Input
  4. Keyboard Shortcuts with the Commands API
← Back to Browser Extensions Development (Chrome & Edge)