Kim Honoridez Kim Honoridez - 3 months ago 10
Javascript Question

Is it possible to remove "Inspect Element"?

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.

Answer

It is possible to prevent the user from right clicking like this (javascript):

document.addEventListener('contextmenu', function(e) {
  e.preventDefault();
});

The menu won't show but the user will still be able to inspect code through the console (by pressing F12 in Chrome for example).