Is it possible to remove or disable "Inspect Element" context menu in Chrome App via Javascript?
I have searched through several forums but there are no definite answer.
Disclaimer: You shouldn't do this, it's like hijacking the scroll, at best it will annoy your users. It may also restrict access to some right-click only browser features.
It is possible to prevent the user from opening the context menu by right clicking like this (javascript):
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
By listening to the contextmenu
event and preventing the default behavior which is "showing the menu", the menu won't be shown.
But the user will still be able to inspect code through the console (by pressing F12 in Chrome for example).