How to uninstall/remove Developer Tools from Google Chrome?

后端 未结 5 2212
野性不改
野性不改 2020-12-17 19:05

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.

相关标签:
5条回答
  • 2020-12-17 19:09
    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!!

    0 讨论(0)
  • 2020-12-17 19:10

    disable-dev-tools
    Working 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/

    0 讨论(0)
  • 2020-12-17 19:25

    Disabling the developer tools is difficult but you can do it:

    1. Open Chrome (Or Chromium).

    2. 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.

    3. Close all Chrome windows.

    4. 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.

    5. 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.)

    6. Change this section so it looks like this:

      "devtools": { "disabled": true, "split_location": 256 }

    7. Save the file.

    8. Start Chromium. Press F12. Nothing happens. Press Ctrl+Shift+J. Nothing happens. Right-click and try to select the Inspector. Doesn't work.

    9. Be happy.

    0 讨论(0)
  • 2020-12-17 19:30

    Use the policy DeveloperToolsDisabled - see https://www.chromium.org/administrators/policy-list-3#DeveloperToolsDisabled

    0 讨论(0)
  • 2020-12-17 19:30

    Unfortunately it is not possible at the moment.

    0 讨论(0)
提交回复
热议问题