Answer the question
In order to leave comments, you need to log in
How to protect site code when viewed in a browser editor?
Hello, please tell me how to be. There is a site where I provide demo templates and the question is to hide the code there from draining the template (displaying in a frame or something else), for example, you press the button to view the template demo, and it redirects to a page with an encrypted code inside, but the template itself shows fine. If anyone has experienced this, can you please let me know if this is possible? (I hope I explained well)
Answer the question
In order to leave comments, you need to log in
There is no universal protection - the code is still executed on the client, and in any case it can be downloaded / copied.
However, as a protection against completely unprofessional ones - you can add such code to js scripts (including libraries like jQuery) (after obfuscating it)
if(document.domain!="yourdomain.com"){
self.location.href = "http://yourdomain.com";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question