1

Is there a way to hide the Javascript files from being seen when we open the developer window. Users have become smarter and they google and find a way to see the code by opening the developer window. Is there a way to avoid this?

4
  • 3
    No there is no way to do this. You shouldn't put any vulnerable stuff in your code. Commented Mar 24, 2016 at 16:06
  • 2
    You can concatenate and minify to obfuscate your code however it can never be blocked. Also new browsers have ways of 'prettifying' your minified code anyway. So long as your server side validation is strong on any client side data sent to it it doesn't matter what they do on the client. Commented Mar 24, 2016 at 16:08
  • 3
    Keep your business logic in your server code. Client-side js is for your clients, so avoid anything you don't want to share with your clients. (e.g. private keys, etc) Commented Mar 24, 2016 at 16:10
  • The question is; why would you want to hide your code? Commented Aug 15, 2016 at 22:17

1 Answer 1

8

JavaScript code is going to be visible no matter what you do. It's client side script. Never store any sensitive code or data in anything on the client side. Your only option is to have anything that you wish to be obfuscated from users on the server side. You can't do that with JS, as that's on the client side.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.