How to Disable Developer Tools & Right Click Context Menu in Google Chrome Using Javascript
4 views
Jul 3, 2025
Get the full source code of application here:
View Video Transcript
0:00
Uh hello guys, welcome to this video. So
0:02
in this video, I'll show you how to
0:04
disable developer tools and rightclick
0:06
context menu inside your browser Google
0:09
Chrome browser. So for this I have just
0:11
written a little bit of snippet of
0:13
JavaScript code here. So this is a
0:15
simple HTML document and right here what
0:19
we have done we have disabled the
0:21
ability to rightclick. So I am just
0:23
right clicking it but now it is
0:25
disabled. So I can't go to the developer
0:28
tools. By default what we see if you
0:32
want to prevent the access to the
0:35
if I delete this and again open this
0:38
what you will see the user may go to the
0:40
developer tools by right-clicking it go
0:42
to inspect and go to console. This is
0:45
the developer tools section right here.
0:47
So if you want to disable the rightclick
0:49
a ability right here I have given this
0:52
code in the description of this video.
0:54
simply paste this code. So essentially
0:57
what this code is doing, it is actually
0:59
checking that if the user presses either
1:02
F12 or they actually right click. In
1:06
both the scenarios, we are disabling the
1:08
capability.
1:10
So the user can't press the F12 key on
1:14
the keyboard to open developer tools or
1:17
nor they can right click. So this is the
1:19
source code I've given in the
1:21
description of this video. So you can
1:22
check out in this easy way you can
1:24
disable developer tools inside your
1:27
Google Chrome browser.
1:29
So thank you very much for watching this
1:31
video and also check out my website
1:33
freemediattools.com
1:35
uh which contains thousands of tools.
#Computer Security
#Scripting Languages