0

In my chrome extension I add a couple of entries to the context menu of the browser action.

chrome.contextMenus.create({
    id: 'browser_action_support',
    title: lang.POPUP.SUPPORT,
    contexts: ['browser_action'],
    onclick: function () {
        chrome.tabs.create({'url': paths.knowledgeBase});
    }
});

However there seems to be one entry added automatically at the top. This entry just displays the extensions name defined in the manifest file. In addition this entry is a disabled and won'T do anything on clicking.

enter image description here

{
    "manifest_version": 2,
    "name": "__MSG_extName__",
    "short_name": "__MSG_extShortName__",
    "description": "__MSG_extDescription__",
    ...
}

However other Extensions like AdBlockPlus have a clickable link at this position. So how can i either make this title clickable with a callback (which then handles the redirect) or remove this entry so i can just insert a link like i do with my other entries?

1 Answers1

0

Thx to Iváns comment I figured it out.

With the homepage_url parameter in the manifest file the context menus title link can be set manually. If the homepage_url is not set in the manifest, it will automatically link to the extensions chrome webstore page.

see Manifest - Homepage Url.

  • 1
    The entry doesn't link to the Web Store, but to the extension's homepage URL, as defined in manifest's `homepage_url` entry. – Iván Nokonoko Nov 01 '18 at 15:42
  • 1
    Thx for the hint to `homepage_url`. Kinda missed this completly. But if `homepage_url` isn't defined, it will just link to the extension's own page within the chrome webstore. [Manifest - Homepage Url](https://developer.chrome.com/extensions/manifest/homepage_url) – Honkalonkalooooohhh Nov 02 '18 at 09:02
  • @Honkalonkalooooohhh Would you mind editing your answer to include info about the `homepage_url`? – Xan Nov 02 '18 at 10:09