Is there any efficient way or plugin to include in order to hide javascript from being seen on the inspect element?
Asked
Active
Viewed 50 times
-3
-
You cant hide that, but you can minify that,so it will be unreadable. – Nitin Dhomse Nov 16 '17 at 07:25
-
No. But you can use tools like webpack or grunt, you can make it less readable – Rajesh Nov 16 '17 at 07:26
-
JavaScript runs on the client (in this case), so you will have to send it to the client/browser in order to run it there. If you send something to the client, they can see it. Security through obscurity, in this case, is definitely not the way to go. – Milanzor Nov 16 '17 at 07:26
-
You cant hide your code, but you can make it less readable by obfuscate, minify... – Berserk Nov 16 '17 at 07:27
-
3Possible duplicate of [How can I hide my javascript source in browser?](https://stackoverflow.com/questions/21280732/how-can-i-hide-my-javascript-source-in-browser) – JJJ Nov 16 '17 at 07:28
-
Please use the search next time, this has been asked hundreds of times: https://stackoverflow.com/search?q=hide+javascript+source – JJJ Nov 16 '17 at 07:28
1 Answers
1
One word answer: no.
It is a badly created site if the site's security depends on "hiding" the source code. Try uglifying your code if you really don't want others seeing it, but it can always be reverse-engineered.

Derek 朕會功夫
- 92,235
- 44
- 185
- 247
-
2
-
-
1Its a valid answer. Thats why I added *in my POV*. But the reason I commented was, its a fairly basic question and you can find answer on google. There is even a dupe, so we should rather look for such posts and close it. Since you know the solution, you are more likely to get a better dupe then OP. But this all is again my POV. – Rajesh Nov 16 '17 at 07:38