javascript - Safari extension – context menu item renders TWICE - Stack Overflow

admin2025-04-26  8

I render three new context menu items through a Safari extension like this:

browser.contextMenus.create({
  id: 'copy-this',
  title: 'Copy this',
  contexts: ['selection', 'link']
});

browser.contextMenus.create({
  id: 'copy-that',
  title: 'Copy that',
  contexts: ['selection', 'link']
});

browser.contextMenus.create({
  id: 'do-this',
  title: 'Do this',
  contexts: ['selection', 'link']
});

When right clicking on regular text, these menu items render fine. Just once per.

I don’t even specify editable contexts, and yet when the user right clicks on text in a textarea, say, the above menu items render twice.

Ideally, they shouldn’t render at all in editable contexts. How do I do that?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745664686a312960.html

最新回复(0)