Is it possible to programmatically open the context menu (contentAreaContextMenu)? Basically, I just want to have the ability to send a right-click MouseEvent to the tabbrowser when a certain action is performed. I wasn't quite sure how to piece the code below to achieve this behaviour.

In my code, I have an event listener which is fired when the mouse is clicked but I want it so that it will change the button type to 2 (right click).

function onClick(aEvent) {
  var evt = document.createEvent ("MouseEvent");
  evt.initMouseEvent("click", 1, 1, window, 1, 10, 50, 10, 50, 0, 0, 0, 0, 2, null);

  aEvent.target.dispatchEvent(evt);
}

Any help would be great or point me to some documentation. Thank you very much in advance!

- Todd
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to