I’m developing a commercial software project that has some sensitive JavaScript code.
I know that’s impossible to prevent anyone from seeing my code, so I looked into ways to make it more difficult to do so, and I found this page witch looks promising, as it locks the JavaScript from being accessed from any other page/URL.
So my question is how secure is this solution?
Feel free to suggest any other ways to “hide” the JavaScript code.
It’s not, it’s already downloaded to the users machine, they can look at it in their script debugger, there’s nothing you can do to prevent someone from looking at your code, the best you can do is obfuscate it but that only deters the casual thieves.
Also if you’re putting sensitive code on the client side then you may want to refactor your architecture.