Chrome extension: context parameter in chrome.contextMenus.create is being ignored

139 Views Asked by At

So I got this piece of code from my extension (I'm currently using webextension polyfill), it successfully creates the context menu and it's accessible when in foo.bar, The issue is in the browser_action context menu, it's always there, I've specifically declared "page" as context when creating the contextMenu,:

browser.contextMenus.create({
    id: "some-id",
    title: "context menu message",
    documentUrlPatterns: ["*://foo.bar/*"],
    contexts: ["page"]
});

According to docs, I should add "browser_action" to make it appear in the browser_action context menu, however I've not included it yet always appear there, even if the current URL doesn't match documentUrlPatterns. This only happens on chrome based browsers, it works perfectly in firefox.

0

There are 0 best solutions below