Change label in the contextmenu before the opening

See Implement onBeforeShow event

As a workaround until it’s fixed, listen to “mousedown” and “keydown” events and send message to background.

window.addEventListener("mousedown", evt => {
  if (evt.button === 2) {
    browser.runtime.sendMessage();
  }
}, true);
window.addEventListener("keydown", evt => {
  if (evt.shiftKey && evt.key === "F10" || evt.key === "ContextMenu") {
    browser.runtime.sendMessage();
  }
}, true);
1 Like