views:

314

answers:

8

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.

A: 

You can't ever disable it.. users can view the source of your page so the text is always available. If you put click handlers to disable right-click, they can turn javascript off..

The best you can try to do is make it inconvenient for people to deter them, but never can you prevent them.

Dan Heberden
+9  A: 

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.

Sev
yeah..! its fine..! how do I give "the people who don't know much about technology that trouble"?
1s2a3n4j5e6e7v
when I was not able to find it by Google, I came to stack overflow. I want specific answer, for answers like these, I could have used Yahoo Answers :P
1s2a3n4j5e6e7v
Check out the best answer for this!
1s2a3n4j5e6e7v
+2  A: 

To be honest, if you don't want people to use any information on your site, then you can't put it up there. If you stop them from being able to copy and paste the information, they'll still be able to take a screenshot of it, type it out and save the data that way. I know it's not the answer you're looking for, but that's just something to think about.

(I did this because i can't comment yet).

fortheworld
screenshot is fine! but what's it for disabling copy paste! thats what I'm looking for...
1s2a3n4j5e6e7v
+1  A: 

Forget it. It is not possible to block these functions in a browser. The "best" you can do is to present your data in an image or Flash movie - inconceivable, slow, impractical, horrible to implement and also circumventable using OCR software.

If all else fails, users will simply make screen shots or key in the data manually.

If you present data to your users, you will have to live with the possibility that they can copy it. End of story.

Use legal threats to prevent your contents, not technical means.

Pekka
and even an image can be sent to an ocr pretty well. Unless the whole page ends up looking like a captcha lol
Dan Heberden
+1  A: 

It is impossible to secure a website against copying. There are some technices to make it more difficult, but as soon as the user has the information on his screen its already too late. He could for example take a picture with a camera if the screenshot function could be disabled somehow.

Disabling of javascript functionality (f.e. shortcuts) is not working in all browsers and the user may disable javascript.

Using programs like curl all the information on the webpage can be grabbed.

Best thing you could do is to put all the information you present into an image.

Thariama
Ah, but then he'd have to put it all back into alt, title, meta tags, etc. to have any SEO. D'oh!
Brock Adams
right, but the overhead(+transmission time) to create an image from a dynamic page is huge
Thariama
+1  A: 

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.

Sohnee
Thanks for writing this explanation :) but doesn't help :(
1s2a3n4j5e6e7v
+3  A: 

By default, Chrome and Firefox block disabling the right click menu. You have to manually edit an entry in about:config in Firefox to prevent it being blocked, which is not something you can force your visitors to do.

Regarding IE, you can modify your BODY tag like so:

<body onContextMenu="return false">

Which will prevent the right click context menu.

Other than that, the next best step is to create an image of your text, place it in a .swf (flash) document, and point the page to load the .swf as the page. This will cause all browsers to display the flash context menu on right click, and will prevent simple copy/paste efforts.

I do agree with previous replies, regardless of method used, any user can simply use their Print Screen key, paste the image in Paint (or other program), save it, and use OCR to grab your text.

FWishbringer
Even on IE, this only disables right-click menu and only if the user enables blocked contents. However, the user can still highlight text and press Ctrl-C to copy it.
PauliL
A: 

The ultimate solution is <div onselectstart="return false;" onclick="return false;" onmousedown="return false;" onfocus="return false;"> You can't cut or copy with JS Enabled. </div>

1s2a3n4j5e6e7v