views:

669

answers:

10

I am currently doing a project, in which I need to stop the user from taking the snapshot of any Web Page, for which he can use the "Print Scrn" / "Printscreen" key available in any of the normal keyboards.

I have been trying to find its solution, but in vain. If possible, I need to take into account of the "Screengrab" add-on of the Firefox browser, by stopping it also.

Any help is greatly appreciated, and I am using PHP (as server-side language) & jQuery for my project.

+31  A: 

This is not possible.

Sjoerd
And if it were, it would be circumvented quite quickly.
revil
Wheee, NoScript!
Matthew Scharley
The "print screen" key is an OS functionnality, and you have absolutely no right to alter its behaviour from a web page. This is like installing a software on the hard drive. Generally speaking, there is no real way to prevent an user from downloading the content of a website. You can just make it a little more difficult, but it would only be a matter of time.
kbok
In general: at some point the data must be displayed to the user. At that point, any determined user can capture it. If nothing else, there are devices that will sit between your PC and monitor, completely seperate from the PC and record anything sent to the monitor.
Matthew Scharley
Or they can use a camera, which may be totally unattached to any computer. They could even use a camera which records on film without any digital components at all; no way to stop that other than to never show the information to the user at all.
Donal Fellows
Such a restriction would be so annoying to users that they would probably never go back to your page again. That would prevent them from printing, but I don't think that's what you want. BTW writing a code snippet that downloads a page is as easy as WebClient.DownloadString (if you write .NET) or any of the myriad equivalents in other languages
Panagiotis Kanavos
you can implement your own OS though...
JSmaga
@JSmaga That'll be the most single-purpose OS ever: "Features: **Can't take screenshots!** " ;D
deceze
@deceze In 6 months you can release the service pack 1 including the "Anti copy-paste feature"
JSmaga
@deceze @JSmaga well.... It still would be better than Vista! http://xkcd.com/528/
Pekka
Even with an OS without screenshot abilities, you could still put the screen on a scanner or take a photo of it :p
Svish
+1  A: 

Try this

$(document).keyup(function(e){
  if(e.keyCode == 44) return false;
});

Hope it works

ZX12R
This falls apart very quickly: simply focus on a different window, *then* screengrab.
Matthew Scharley
Upvoted for the effort!
Chetan Sastry
+13  A: 

Thankfully, this outrageous idea is not possible to implement reliably, neither the "disable screen grab" part nor the "disable user's Firefox extensions" one. And even if it were, as @kbok points out in his comment above, you don't have a right to do this.

The only way to protect your content online is copyright laws - mentioning those is often enough to scare people away from misusing it! - or not showing it at all.

Pekka
+1  A: 

Like @Sjoerd said, this is not possible.

If it is pictures you want to protect, I suggest you for example display lower quality images that are watermarked instead and only display the non watermarked high quality ones when appropriate.

But yeah... If you want them to be impossible to copy... don't put them online.

Svish
I don't like this term "not possible"... of all the things in the universe this is not something I would say is "not possible". I think the word unfeasible is better suited. Maybe I’m being pedantic, but I just don't like us, as the human race, selling ourselves short. Someone could do it if they really wanted. Hence... entirely possible.
Kohan
Although you don't like, there are many imposible things. And this is one of those.
Hernán Eche
Yeah, how on earth would you make that impossible? If it's on the screen, it's nothing you can do. How would you prevent someone from taking a camera and shooting a photograph of the screen for example?
Svish
+1  A: 

Why do you want to prevent the print screen?

If it's some photos you want to protect, you might want to put it in low resolution, and include some kind of copyright logo programmatically in php.

I think that's pretty much it.

JSmaga
A: 

if it works, it only will work if the user has js enabled. there are also several tools to make screen shots - its not possible to stop user from using this method to grab elements.

Moritz
+3  A: 

What if they take a photo of their monitor!?

You'll have to code something to make their camera self-destruct.

C.McAtackney
+15  A: 

You can't disable screen grabbing from the Web browser, it would only be possible by installing additional software on the user's PC.

There are some IRM (Information Rights Management) tools available that do that e.g. by protecting Windows/DirectX API calls and also monitoring video memory such as Oracle IRM or such as Microsoft's IRM technology.

Especially the latter might be of interest as there is also a Rights Management Add-on for Internet Explorer.

But as other already said, any IRM/DRM technology is controversy and you should understand that it most often will limit or annoy your users.

0xA3
Your answer is the most informative of the lot. Thanks very much!
Knowledge Craving
yup, +1 for solid info.
Pekka
I wouldn't say IRM is a "controversy". On the internet it is foolish to even consider it, but on a corporate environment it makes sense. Companies have IRM installed in every computer, and for a good reason. It sends a clear message to employees: "This data is sensitive". If it isn't trivial to copy the data, the employee wouldn't try further.
Kobi
@Kobi: Those who think to steal corporate data won't stop because of IRM, which is why it's pointless, IMHO. In environments where it's possible, they'll use a myriad of other options, like the ubiquitous 5 MP cellphone camera. You may make it harder for them, but you won't stop them.
Chris Kaminski
@Chris - "Never attribute to malice that which is adequately explained by stupidity". If a hostile employee can see it she can steal it, however, IRM is very efficient in restricting data and preventing *unintentional* data leaks, and makes a good way of marking sensitive documents.
Kobi
+1  A: 

The last time such idiotic websites happened my way, and I needed to print something (and surprise! The print button was disabled too!), I ran the damned site in a virtual machine, and took a copy from that.

As a result, I was able to discuss results with a group of people who needed to look at the printout rather than having the group huddle around my computer which, thanks to the website in question, would process each click oh so very slowly. Printing it saved hours of my time.

(And before you ask... Yes, that was perfectly legal).

Arafangion
A: 

You can change the contents of the clipboard using JavaScript or Flash. This already helps a bit.

Leo