Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:07:22+00:00 2026-06-13T01:07:22+00:00

Its been hours now that I’ve been stuck in this problem, does anyone know

  • 0

Its been hours now that I’ve been stuck in this problem, does anyone know how to show a context menu every time the user clicks on the google chrome extension.
I managed to display the menu with my default_popup, but I found out that I should implement this on a context menu.

Here’s the image:

I have this following code

manifest.json

{
    "name": "Hello Toolbar",
    "version": "1.0",
    "manifest_version": 2,
    "description": "A Toolbar that helps.",
    "browser_action": {
        "default_icon": "icon.png"
    },
    "background": {
        "scripts": ["background.js"]
    },
    "permissions": [
        "cookies",
        "http://*/*",
        "tabs",
        "contextMenus"
    ]
}

background.js

chrome.browserAction.onClicked.addListener( function(tab){
    chrome.contextMenus.create({"title": "Test parent item", "contexts": ['page']}); 
});

but it doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:07:24+00:00Added an answer on June 13, 2026 at 1:07 am

    I think that your expectation of the chrome.contextMenus API is wrong. It can never be used to open a context menu. It can only tell Chrome to show context menu entries when some custom conditions have been met (see the documentation of the create method for to learn about defining these conditions).

    In the screencast below, I show the expected behaviour for your code.

    • No context menu shows up unless the user right-clicks.
    • After clicking the browser action button, the context menu entry shows up when opening the context menu within the page.

    If you want a “popup” to appear on click, use the "default_popup" entry in the "browser_action" section of the manifest file. Then, the following shows up:

    You can use CSS to get the popup to look like a “context menu”. The Browser action documentation provides an some examples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a way to do this? Im sure its been done
I've been trying to figure this out now for a few hours and its
I've been struggling with a RMI problem for a couple of hours now. Its
I feel like I should know this but I've been stumped for hours now
I have been trying to solve this problem for over 14 hours now...I am
it's been a couple of hours now that I'm working on this and I
been fighting with this problem for a good 3 hours now, and i figured
i have this problem that has been buggin me for the last hours. Lets
I've been at this for hours now and it's starting to get upsetting. :(
Been chasing this problem for a few days now. It comes and goes...meaning, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.