How to prevent html/JavaScript code modification

前端 未结 8 1843
一向
一向 2020-11-30 13:17

I would like to know if there is a way to prevent an html page with jQuery or javascript to be modified by the user to change its behavior.

A user can modify it usin

8条回答
  •  失恋的感觉
    2020-11-30 13:41

    To defeat the method described in the question:

    • You can use the keyboard shortcuts to the console/tools (Ctrl+Shift+I in Chrome)
    • You can use the resource/net panel to see the source
    • You can see it at any other level, e.g. Fiddler
    • You can use a bookmarklet for easier access

    No, you can't prevent people seeing or modifying your source/script if they want to...the ones you most want to prevent are the most able to circumvent any deterrent (and that's all anything you do is, a deterrent, not a stop) you put in place.

提交回复
热议问题