0

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.

Misko Jones
  • 87
  • 1
  • 8
  • Chrome remembers menu items that you created before. Use chrome.contextMenus.removeAll – wOxxOm Jun 23 '21 at 11:25
  • @wOxxOm I'm actually removing the extension from the browser every time I try to change the context or the pattern. Still there in the browser_action contextMenu. – Misko Jones Jun 23 '21 at 11:49
  • I can't reproduce this problem, the API works correctly here so the problem is in your code or in the polyfill. – wOxxOm Jun 23 '21 at 12:45

0 Answers0