# Change label in the contextmenu before the opening

**URL:** <https://discourse.mozilla.org/t/change-label-in-the-contextmenu-before-the-opening/16620>\
**Category:** Development\
**Created:** [June 22, 2017, 7:37pm UTC](https://discourse.mozilla.org/t/change-label-in-the-contextmenu-before-the-opening/16620 "2017-06-22T19:37:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![asamuzaK](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/asamuzak/32/18266_2.png) [@asamuzaK](https://discourse.mozilla.org/u/asamuzaK)\
**Post date:** [June 23, 2017, 2:35am UTC](https://discourse.mozilla.org/t/change-label-in-the-contextmenu-before-the-opening/16620/2 "2017-06-23T02:35:51Z")

</div>

See [Implement onBeforeShow event](https://bugzilla.mozilla.org/show_bug.cgi?id=1215376 "1215376 - Implement onBeforeShow event")

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

```auto
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);

```

---

_[View the full topic](https://discourse.mozilla.org/t/change-label-in-the-contextmenu-before-the-opening/16620)._
