How do I protect my HTML source code?

How do I protect my HTML source code?

Your only true options for protection involve copyrighting the code and, potentially, filing a patent. If what you are doing is truly different, then a patent is probably the best way to go. Typically the value in your application is really going to be in the support area.

How do I hide HTML code in browser?

The text will remain in the HTML code, but not in a user’s browser window.

  1. Launch your HTML editor.
  2. Locate the text within the HTML document you want to hide.
  3. Type “<” followed by “!
  4. Type “—” followed by “>” (no quotes and no spaces) at the end of the block of text you want to hide.
  5. Save your HTML document.

How do I disable right click in HTML?

$(“html”). on(“contextmenu”,function(e){ return false; }); In the above code, I have selected the tag. After you add just that three lines of code, it will disable right click on your web page.

Is client side JavaScript safe?

Client side data is always unsafe. That being said, you can make it safe by parsing it (pun not intended) to ensure anything potentially dangerous is stripped out before running it. The safety in this system then, is dependent on how well you write your code.

How can I hide my website code?

You need to set a password to decrypt it ….you choose the password. After encrypting it, you can just write a basic HTML page just putting into the tag once again the script to disable the right click, into the tag you code and hide everything just writing at top of the page .

How to protect the source code of JavaScript?

All a user needs to do to discover your code and it’s location is to look in the net tab in firebug or use fiddler to see what requests are being made. Google Closure Compiler, YUI compressor, Minify, /Packer/ etc, are options for compressing/obfuscating your JS codes.

How to prevent JavaScript code from being hacked?

If you have big secrets, keep them on the server. Then bundle all your JS files in one file, that you obfuscate. This should prevent many people to go further, and as well reduce size and http calls. But this won’t stop the real bad guy if any.

How to prevent JavaScript code from being viewed?

If you really need to protect the code from being viewed, don’t do it in client side JS. Put it on the server and just use JS to communicate with that. Especially in modern browsers, it’s a complete waste of time. I can use Firebug to see somesecret.js… as for the other I’m better if you’d scrolled down you’d see the source.

How to protect a JavaScript file in PHP?

Have the PHP locate the file (maybe on a non-public part of the server), open it with file_get_contents, and return (read: echo) the contents as a string. When this string returns to the JavaScript, have it create a new script tag, populate its innerHTML with the code you just received, and attach the tag to the page.