How to hide HTML, CSS and JS code from being viewed on the browser?

Hi,

How to hide HTML, CSS and JS code from being viewed on the browser ?

I tried some tools to obfuscate or minify but then the code shows broken

How do I keep secure a website made with HTML, CSS and JS ?

You don’t really get security from obscurity. The client site code must be assumed to be fully viewable to the end user.

is there a reason for your question? For eg are you including personal or security related values in your html/css/js ?

That is why you keep anything sensitive on the backend. You can’t secure the source running in the browser, but you can make sure the client isn’t doing anything stupid, like leaking data or talking directly to things a backend should be handling.

If you can obfuscate it, you can deobfuscate it. Just as you can disassemble, decompile, or attach debuggers to executables. Don’t leave anything sensitive in the code.

1 Like

to avoid having bots messing with my code
(as that is what I found through the control panel on the errors folder)

I will start adding cloudfare firewall and CDN soon

but is there something else I could do to protect my code?

it is a business website displaying pages and products but without an e-commerce

Any HTML/CSS/JS in the front end must be assumed to be publicly accessible since its running on user’s computers.

Obfuscation is not protection.

Could you elaborate on this, I’m not sure if I understand the issue or how obfuscating the code would help?

What do you mean by “having bots messing with my code”?