Reputation: 13
I have copyright content. So I don't want any of the users to view the source code of my page or download content using JavaScript.
So, is there any way to block JavaScript command execution from Firebug or similar tools and only allow page-level JavaScript?
Upvotes: 0
Views: 76
Reputation: 20095
It is technically not possible to disallow the client to view and modify the code on the client-side, nor block the user from using the command line of his favorite DevTool. See also How to disable browser developer tools?.
What you can do is to obfuscate your JavaScript code using a minifier. This makes it harder for users to read your code, though they can still copy it and do with it what they want.
When your code is copyrighted, you should explicitly mention that on your website, e.g. within a separate terms & conditions page. If you offer files for download, you should include the copyright information within those files.
Also note that in order to protect your website against hacker attacks, you must validate user input on the server side.
Upvotes: 1