Cannot prevent 'contextmenu' in firefox

I tried:

cm.on('contextmenu', (cm, e) => {
  e.preventDefault();
  e.stopPropagation();
  e.codemirrorIgnore = true;
  return false;
});

cm.on('mousedown', (cm, e) => {
  if (e.button == 2) {
    e.preventDefault();
    e.stopPropagation();
    e.codemirrorIgnore = true;
    return false;
  }
});

cm.getWrapperElement().onclick = (e => {
  if (e.button == 2) {
    e.preventDefault();
    e.stopPropagation();
    e.codemirrorIgnore = true;
    return false;
  }
});

but firefox still shows the browsers context menu on right click :frowning:

If I do

  cm.getWrapperElement().oncontextmenu=(e => {
       e.preventDefault(); 
       e.stopPropagation(); 
       return false; 
  });      

It seems to work fine.

see: https://plnkr.co/edit/Zn2YtzMEcEgP7HW99GP0?p=preview

any help ?

Due to the fact that our context-menu support hack has to happen on mousedown in Firefox, because it is too late when the contextmenu event fires, we’re not handling the contextmenu event at all on that platform. A patch that adds a stub event handler that only fires CodeMirror’s own contextmenu event in that case would be welcome.

Can you please elaborate your answer:

I created one contextMenu on the right click. Its working fine on chrome browser but the same if I runs on firefox …nothing is happening.

Please suggest