Is there a way to disable inspect element, right click and F12 in google chrome?
-
Refer this Link:stackoverflow.com/questions/5692006/…– SundarCommented Dec 18, 2013 at 13:53
-
Do you want a webpage or app to do this (not possible) or a system administrator (or user) to do this?– apsillersCommented Dec 18, 2013 at 14:31
-
on a web page say:www.google.com on right clicking inspect element should not be present– User2364902Commented Dec 18, 2013 at 14:33
-
And why would you need to do this?– Sergey ShevchenkoCommented Dec 29, 2013 at 6:07
-
@Dear P.s vinoth are you find the answer,If then kindly guide me.– RahamCommented May 3, 2016 at 4:49
2 Answers
This is definitely not possible to do from a web page.
Even if you disable right click and disable the default behaviors for F12, Ctrl+Shift+I, and Ctrl+Shift+J, there is no way to stop a user from opening Dev Tools on a different page and navigating to your page with Dev Tools already open.
Also, you can access Dev Tools by going to Menu > Tools > Developer tools, which cannot be prevented by any website.
-
2yeah in-order to prevent the right-click & F12 i used added this code to my DOM window.oncontextmenu = function () { return false; } document.onkeydown = function (e) { if (window.event.keyCode == 123 || e.button==2) return false; } Commented Dec 18, 2013 at 15:13
-
What an absolute statement to make. It is possible, one just have to think hard enough.– mjsCommented Aug 10, 2016 at 17:26
-
@momomo If you have thought of way that it is possible, please feel free to post an additional answer. Commented Aug 10, 2016 at 17:38
-
Yes, and it works. Let's just say the question is how much one is willing to destroy the user experience and how much it is worth to keep them out. I am not going to into great details because it is not in my interest for everyone to start doing that, which will likely become a big enough answer making my life more and more difficult when I start inspecting other sites in the future. But for my site, I want to keep them out ;)– mjsCommented Aug 10, 2016 at 18:04
-
@apsillers Think harder. The detection of the dev tools opening is not the question here. That is already possible using various tricks. Once detected there are a number of things one can do.– mjsCommented Aug 10, 2016 at 19:26
You can run chromium in a java environment. This I have seen, then its impossible to open developer tools, and settings etc are not accessable. But of course it would involve a lot more work and development time.