View Full Version : How Can I prevent people from saving my webpage/site?
Dinold
12-16-2008, 04:48 PM
Hi, Is there any code, that would prevent users from saving the webpage or viewing the source code.
I did try html protector/encrpter that only works well with Interent explorer but in mozilla firefox you can easily view all the sourcecode.
Is there any script that will disable people from the saving the entire webpage or atleast hide the source code in all browsers.
thank you.
Snookerman
12-16-2008, 04:59 PM
Not possible, if the browser can see the page, the user can view the source code and save the page. Here is another thread that deals with the issue, I suggest you do a search next time..
http://www.dynamicdrive.com/forums/showthread.php?t=2184 (http://www.dynamicdrive.com/forums/showthread.php?t=2184)
the thing that lots of people don't "get" is that, in order to view a webpage, the user's computer must first save and then display the page (source code), not view it first and then save it. It's not like TV, where viewing and saving are separate things. Preventing the user from saving the source would also prevent them from viewing the page.
diltony
12-16-2008, 09:41 PM
the thing that lots of people don't "get" is that, in order to view a webpage, the user's computer must first save and then display the page (source code), not view it first and then save it. It's not like TV, where viewing and saving are separate things. Preventing the user from saving the source would also prevent them from viewing the page.
Yes you can, if you load in the contents dynamically with ajax, u cant save it perfectly, at least not the innerHTML property fetched via ajax. Then u can prevent your images from being downloaded at least not as easily as saving pages by encapsulating them in style sheets, i cant fully explain this, but if u need it u can tell me, i will post a private example to u.
Then, there was something i saw once on a microsoft website, it actually cleared out the code from browser, i dont know how it did it, there was just this huge gap, i was tryin to lift a code [i cant remember what code now], but i was not able to finish up with that.
Snookerman
12-16-2008, 09:45 PM
OMG, admin please close this thread!
Yes you can, if you load in the contents dynamically with ajax, u cant save it perfectly, at least not the innerHTML property fetched via ajax. Then u can prevent your images from being downloaded at least not as easily as saving pages by encapsulating them in style sheets, i cant fully explain this, but if u need it u can tell me, i will post a private example to u.Wrong. It's perfectly possible still. For example, simply execute the Javascript:
javascript:void(document.body.innerHTML = "<pre>" + document.body.innerHTML.toString().replace(/&/g, "&").replace(/</g, "<") + "</pre>");Dinold, you should ask yourself: why do you even want to do this? Are you ashamed of your code? Or are you merely feeling malicious and wanting to make it harder for Web-design newbies to learn from the Web? The Web is by its very nature open. Accept it, or design an alternative (though I doubt many people would switch :p).
Thread closed; there are a large number of other threads already discussing this.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.