Our users should use Ctrl+Shift+J shortcut in web application.
We have tried Chrome switchers like \'--disable-dev-tools\' but it not works in our scenario.
window.oncontextmenu = function () {
return false;
}
document.onkeydown = function (e) {
if (window.event.keyCode == 123 || e.button==2)
return false;
}
Use this code to disable rightclick & F12 on ur page, but there is no way to stop a user from opening Dev Tools Menu > Tools > Developer tools
Hope this helped!!
disable-dev-toolsWorking great for me, Are you sure you're not writing something wrong, please recheck.
See: http://www.chromeplugins.org/tips-tricks/chrome-command-line-switches/
Disabling the developer tools is difficult but you can do it:
Open Chrome (Or Chromium).
Open the developer tools by pressing F12 and resize the developer tools panel by moving the splitter (Sounds strange, but trust me). You don't have to do this if you are sure that you have resized it before.
Close all Chrome windows.
On Windows 7 open the file C:\Users\YOUR USERNAME\AppData\Local\Google\Chrome\User Data\Default\Preferences
in your favourite text editor. On Linux the file is located at ~/.config/chromium/Default/Preferences
. On Windows XP it may be somewhere else. Don't know.
Search for devtools
. You will find a section which looks like this:
"devtools": { "split_location": 256 }
(That's why I told you to change the panel size in step 2. When you don't do this then this section does not exist and you have to create it manually somewhere.)
Change this section so it looks like this:
"devtools": { "disabled": true, "split_location": 256 }
Save the file.
Start Chromium. Press F12. Nothing happens. Press Ctrl+Shift+J. Nothing happens. Right-click and try to select the Inspector. Doesn't work.
Be happy.
Use the policy DeveloperToolsDisabled - see https://www.chromium.org/administrators/policy-list-3#DeveloperToolsDisabled
Unfortunately it is not possible at the moment.