Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling Copy/Paste in a Web Page

How Do I disable the copy paste feature in my webpage. To be precise, I don't want my users to copy any information from my website and use them for personal purposes. The previous question on the same topic doesn't give enough explanation. The onselect and ondrag aren't working. Please help.

like image 682
1s2a3n4j5e6e7v Avatar asked Jun 11 '10 06:06

1s2a3n4j5e6e7v


3 Answers

I don't want my users to copy any information from my website and use them for personal purposes

There is no way to do this. If someone really wants your information, they can get it.

You might be able to give them a litte bit of trouble with disabling certain functions using javascript or whatever...but you'll only give the people who don't know much about technology that trouble. And usually those people aren't even trying to copy your data. The one's who are, will figure out a way.

like image 56
Sev Avatar answered Oct 11 '22 15:10

Sev


If you publish information online, you should clearly indicate your copyright claim on the page (or indicate the type of license you issue the content under). Please find and read the copyright law of your territory to understand what this does and doesn't allow - for example, in the UK there are provisions for making personal copies of copyrighted material and for using parts of copyrighted work for critical review or parody.

You can't stop people from copying the content on your page. You can make it more difficult for them to do - but this will have a negative impact on your page. Techniques such as preventing the left-click of the mouse, intercepting keyboard events or converting your entire article into images just make your website less usable.

If you have textual information on your website, I can re-type it even if you've stopped every other method of me copying the image. If you have an image and you've managed to lock out everything else, I can still do a screen-grab (not to mention the fact that my browser caches all the images in a temporary folder on my machine).

Your content-paranoia affects many people who set up a website - but the idea behind the Internet is that it is used for sharing information.

like image 36
Fenton Avatar answered Oct 11 '22 15:10

Fenton


Just add the following code to the HEAD tag of your web page:

<script type="text/JavaScript">
//courtesy of BoogieJack.com
function killCopy(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=killCopy
document.onclick=reEnable
}
</script>
like image 26
Hieu Nguyen Ngoc Avatar answered Oct 11 '22 16:10

Hieu Nguyen Ngoc