I am trying to hide the context menu when embedthere is a right-click event in the html file .
The code that I have works fine when I right-click on the embed window, the menu is no longer hidden.
How can I hide the context menu (in some versions of Safari browser version 9.1.1 (11601.6.17))?
Fiddle
Js
if (document.addEventListener) {
document.addEventListener('contextmenu', function(e) {
alert("You've tried to open context menu");
e.preventDefault();
}, false);
} else {
document.attachEvent('oncontextmenu', function() {
alert("You've tried to open context menu");
window.event.returnValue = false;
});
}
source
share