-2

As you all know, its normal to access any webpages source codes, people say:"so what? they can't get your PHP codes, they can't get your SQL codes".

Can't they get my JavaScript codes? yes they can, and I've worked hard on those codes, I spent nights and nights so I can build my site, why should anyone be able to get the codes?

What if one day, you see a website, very similar to yours, what can you do?

What if stupid people, studied those codes and found a bug, WHY?

When webpage source codes are available to public, where is the privacy of your hard work?

Can't we hide them?

Can't we encrypt them?

Can't we disable them?

Can't we do anything?

durron597
  • 31,968
  • 17
  • 99
  • 158
Ali Bassam
  • 9,691
  • 23
  • 67
  • 117

2 Answers2

2

"Can't we do anything?"

No, you can't. You may obfuscate your page source using JS, but that only means a little more time wastage for the one who is interested in your source code. And browser-tools like Chromium Inspector or Firebug will still present you a nice-looking markup tree and all of your CSS. All you are really achieving by obfuscating HTML-documents is, that your visitors PC need to compute the real source code and thus needs a little longer to display the page.

But seriously – how often do you have learned/stolen/copied/get inspired by watching other websites and studying their source?

feeela
  • 29,399
  • 7
  • 59
  • 71
1

If all your concern is to obfusc javascript then try

http://javascriptobfuscator.com/

But I believe no one is gonna steal your javascript code.

dynamic
  • 46,985
  • 55
  • 154
  • 231
  • It's not really needed to re-obfuscate. When I really want that piece of JavaScript then I only need to invest some time to understand an obfuscated piece of code. Obfuscating is not crypting it, it is only the change of names and compressing. – Sven Bieder May 07 '12 at 15:37
  • Yes of course – otherwise no browser couldn't display your page… – feeela May 07 '12 at 15:37
  • @ feeela - that's wrong. no browser can re-obfuscate and that's not needed, because the code is fully functional, just not good readable, when obfuscated. – Sven Bieder May 07 '12 at 15:39