How to disable View source and inspect element

前端 未结 1 1031
暗喜
暗喜 2020-12-11 13:59

How do you disable/ view source/ and /inspect element/, ctrl + u ctrl+shift+I f12 menu bar and right click, also ctrl + s c

相关标签:
1条回答
  • 2020-12-11 14:44

    It is not possible to prevent the user from inspecting code running on their machine. At the end of the day the HTMl they are getting delivered will be readable in plain text. You can cause a nuisance for most people, but this will not be a valid security measure - chrome extensions will still run, for instance, so if someone is using the NoScript extension it will disable all javascript.

    A much better option would be to handle your logic serverside, and only send the client the information they need to know/requested.

    There are some free javascript obfuscators, such as https://javascriptobfuscator.com/. Please remember that it is not a secure method, though.

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