This question already has answers here:
How to prevent your JavaScript code from being stolen, copied, and viewed? [closed]
(10 answers)
Closed 6 years ago.
I mean all the code is rendered as text files written to the client.
Besides of obfuscate and uglify your source code? What can be done to trully protect your JavaScript assets.
YOU CAN'T
You shouldn't even try to obfuscate (not talking about minifying nor compilation) your code because obfuscation makes interpreters less likely to optimize your code. javascript code is not meant to be protected. you should focus on protecting your data not your output or client side code.
Related
This question already has answers here:
How can I obfuscate (protect) JavaScript? [closed]
(22 answers)
how to hide javascript code [duplicate]
(4 answers)
Closed 7 years ago.
Is there anyway to hide or secure my javascript code. Because anyone can easily
see my javascript logic on my website using view page source and it's harmful for me. Please tell me any method you know for securing the javascript code or for making it difficult to understand using any encryption method with cannot easily decrypt.
You can't. Don't put sensitive code, keys, information, or logic on the client. The only thing you can do is make it harder to read by running your code through an obfuscator.
This question already has answers here:
How can I obfuscate (protect) JavaScript? [closed]
(22 answers)
Closed 4 years ago.
I'm installing Intercom (https://www.intercom.com) for customer engagement on my site. With the recommended installation the javascript snippet they gave would have my intercom app_id exposed in the page source.
May not be a big deal, but I was wondering if there was a better way where I could keep that hidden.
May not be a big deal
It isn't.
but I was wondering if there was a better way where I could keep that hidden
You can't.
Intercom need the browser to tell them your ID for their approach to work.
This means you must tell the browser your ID.
The browser is the property of the user and it answers to them.
It is not possible to give the browser information and keep it secret from the user who owns the browser.
This question already has answers here:
How to prevent your JavaScript code from being stolen, copied, and viewed? [closed]
(10 answers)
Closed 5 years ago.
I have inserted my javascripts in the header.php file, but I noticed the whole code can be stolen by simply lookin at the source from within any single post or homepage...
May you suggest me a simple way to hide my javascripts in wordpress somehow to prevent being copied/stolen?
You can't hide javascript. Client always need to access it.
You can minify and uglyfy your code, so it will be hard to read it
This question already has answers here:
How can I obfuscate (protect) JavaScript? [closed]
(22 answers)
how to hide javascript code [duplicate]
(4 answers)
Closed 7 years ago.
Is there anyway to hide or secure my javascript code. Because anyone can easily
see my javascript logic on my website using view page source and it's harmful for me. Please tell me any method you know for securing the javascript code or for making it difficult to understand using any encryption method with cannot easily decrypt.
You can't. Don't put sensitive code, keys, information, or logic on the client. The only thing you can do is make it harder to read by running your code through an obfuscator.
This question already has answers here:
CSS: What does the question mark at the end of css do?
(7 answers)
What does "styles.css?=121" mean in this html code? [duplicate]
(2 answers)
Closed 8 years ago.
Why do use like this filename.css?2 or filename.js?4
What are those numbers after question mark?
I did research online but I didn't find any answer.
Thanks!
These are called cache busters.
Usually, when a browser downloads a file (CSS, JS, etc.) it caches it so that it doesn't have to download it later.
However, this is a problem when you decide to update your file, because the browser thinks it already has the latest version. To work around it, we use the cache busters. When you make a change to the file, you also change the number after the question marks, which tricks the browser into thinking this is a different file for which it doesn't have a cache it, and forces a re-download.
Sometimes JS scripts are created on the fly using server side technologies other times it is simply a version number to help with browser caching issues