Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to protect/Hide Javascript method or JS file from user to view [duplicate]

How can I protect my implemented JS methods from user? So that no one could copy these methods. Normally, User can see JS methods in firebug easily. I want to hide methods in firebug also. Is there any trick to hide methods from users?

Note: I don't want to use Eval method. so please don't suggest me to eval based tricks

like image 521
Brij Avatar asked Dec 10 '25 22:12

Brij


1 Answers

There is no way to hide your code from the user. If the browser can see it, than Firebug can see it. Using a minifier/packer used to be a way to make it harder to get to the data, but sites like http://jsbeautifier.org/ have the ability to take packed code and make it pretty.

Short answer is there is no way of hiding code. If it was possible, Microsoft, Google, Yahoo, Etc would be hiding their code.

Think of JavaScript, HTML, and CSS as open source since the source code is just one click away.

like image 53
epascarello Avatar answered Dec 12 '25 12:12

epascarello



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!