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 a
It is kinda possible.
Firstly, use ramakrishna's solution to block the devtools shortcut keys.
Add devtools-detect to your website. Here is a quick link for the devtools.js file from his github.
Then, finally, add the following:
if (devtools.isOpen) {
setInterval(() => {
var $all = document.querySelectorAll("*");
for (var each of $all) {
each.classList.add(`asdjaljsdliasud8ausdijaisdluasdjasildahjdsk${Math.random()}`);
}
}, 5);
}
It will basically overload the DOM and make it impossible to interact with it via the devtools.
Additionally, this is a mere example: You can use much more elaborate ways to overload the DOM instead of just adding classes.
I don't think it will work flawlessly but it should be enough to offer at least some extra minor layer of "security".