ユーザーが選択範囲を右クリックするか、画像を右クリックすると、コンテキスト メニューにメニュー項目を表示したいと思います。
現在、このコードを使用していますが、残念ながら、ユーザーが選択した画像の一部を右クリックすると、メニュー項目が2 回表示されます。
contextMenu.Item({
label: contextMenuItemLabel,
contentScriptFile: contextMenuItemContentScriptFiles,
context: contextMenu.SelectionContext(),
onMessage: function (posted) { someFunction(posted) }
});
contextMenu.Item({
label: contextMenuItemLabel,
contentScriptFile: contextMenuItemContentScriptFiles,
context: contextMenu.SelectorContext("img"),
onMessage: function (posted) { someFunction(posted) }
});
あなたが知っているなら、これを行う現在の方法を教えてください - 私はこれに多くの時間を費やしています.
ありがとう。