Click to See Complete Forum and Search --> : Disable PrintScreen / Copy/Paste functionality
Caliban
11-14-2003, 02:47 PM
Hi,
I am working in a sort of "virtual classroom". I needed to disable the copy/paste functionality in the application pages, to prevent users for copying the info and store it in their PC. The idea is the user to read, to take notes, etc ... but not to copy the info from the screen, so they have to enter to the page(s) in order to study from there.
I found this piece of code to disable PrintScreen / Copy+Paste functionality:
======
<html>
<head>
<script language="javascript">
function setClipBoardData(){
setInterval("window.clipboardData.setData('text','')",20);
}
function blockError(){
window.location.reload(true);
return true;
}
</script>
</head>
<body onload="setClipBoardData();">
YOU TRY TO COPY AND PASTE THIS SCREEN, AND ALL THE ACTIVE SCREENS
</body>
</html>
======
I noticed the Copy/Paste functionality of my Windows session was disabled (i could not copy and/or paste anything, from the moment I open the page with the code mentioned above) so I had to restart my user session (thank God I didn't need to restart the computer :) ) and then I have my copy/paste functional¡ty back.
Do you have some ideas in order to enable again the Copy/Paste functionality, by modifying this piece of code?
T.I.A
Vladdy
11-14-2003, 03:12 PM
forget about it.
The files ARE stored on the user computer before they are displayed in the browser. What you are doing with this script is as EXTREEMLY annoying as it is easily bypassed by disabling javascript.
Caliban
11-14-2003, 03:22 PM
I agree with you (disabling javascript is the easy way to strike back)
These are the possible ways to copy/paste info:
1) By pressing the PrintScreen key
2) By pressing the keys combination: Alt + PrintScreen
3) By disabling the right mouse
I know how to achieve the points 2) and 3)
but the PrintScreen key code ... I've not been able to control it.
Some ideas about these three points?
T.I.A.
AdamBrill
11-14-2003, 03:46 PM
Originally posted by Caliban
I needed to disable the copy/paste functionality in the application pages, to prevent users for copying the info and store it in their PC. The idea is the user to read, to take notes, etc ... but not to copy the info from the screen, so they have to enter to the page(s) in order to study from there.Absolutely impossible. Fortunately, browsers allow users to have control over their own computers rather than giving the control to the site on the internet. The only thing you could manage by trying to get it to work is getting users to not use your site because of the annoyance. The internet is a public place meant to give out information, not to protect it.
BTW, the list of ways to copy and paste info is about 100 miles longer than that...
Caliban
11-14-2003, 04:19 PM
Hi Vladdy,
first of all, thanx for your interest.
The copy/paste restricts are corporative guidelines. The pages will be published over our intranet, not over internet. And the site must work as i described it. The users agree.
The idea is that the user must be evaluated later, and he must not have the docs in his hands/PC, 'cause he must enter to another pages in which he will be evaluated (in the school -at least in mine- , our teachers didn't let us to have the answers written in "auxiliary devices" like hands, chairs, li'l pieces of paper, etc :) - everything must be in the brain. That's what I want you to understand.
The site works fine with the piece of code I supply, I just only want to know how to activate the copy/paste again, either using a "onclose" event or something like that :) That's all.
I'll keep on receiving ideas.
T.I.A.
AdamBrill
11-14-2003, 05:00 PM
Originally posted by Caliban
The idea is that the user must be evaluated later, and he must not have the docs in his hands/PC, 'cause he must enter to another pages in which he will be evaluated (in the school -at least in mine- , our teachers didn't let us to have the answers written in "auxiliary devices" like hands, chairs, li'l pieces of paper, etc :) - everything must be in the brain. That's what I want you to understand.I understand that, but the internet just doesn't have the capability to control the users browser like that.
Your original code doesn't seem to work for me, but here is how you would stop your original code:<html>
<head>
<script type="text/javascript">
function start(){
block = setInterval("window.clipboardData.setData('text','')",20);
}
function stop(){
clearInterval(block);
}
</script>
</head>
<body onload="start();">
YOU TRY TO COPY AND PASTE THIS SCREEN, AND ALL THE ACTIVE SCREENS
<input type="button" onclick="stop();" value="stop blocking copy/paste!">
</body>
</html>I hope this helps you, but if this is for something official, I would highly suggest that you don't use it since it will be extremely easy to "cheat".
Jeff Mott
11-14-2003, 05:50 PM
The idea is that the user must be evaluated later, and he must not have the docs in his hands/PC, 'cause he must enter to another pages in which he will be evaluated. That's what I want you to understand.Here's what we want you to understand. There is no method that cannot be defeated in a matter of seconds. And maybe they don't even need to save it. What would keep them from leaving the info window open while they proceed to the evaluation? The World Wide Wide was designed to provide access to information, not restrict it. If ensuring this information is not retained in any way is absolutely essential then the WWW is not the medium you should be using.
sanker_s
03-28-2006, 02:05 PM
Thanks for your tip. I tried in IE and firefox. It works in IE but not in firefox.
fb755
03-29-2006, 11:25 AM
What about converting the text to an image or the document to PDF then? They will be able to copy the entire thing, but won't be able to copy and paste text per se.
felgall
03-29-2006, 02:33 PM
You can password protect the select and print facilities within PDFs so that your regular visitors can't do those things with the PDF. It can't be done with HTML.
Wisest Guy
03-29-2006, 02:42 PM
Save page as.
Client saves page then has content.
Or right click a link to page, Save target as.
If you send it to the user, it's too late, they have it.
No way to stop it.
nreb10
01-13-2009, 10:20 PM
Hi Caliban,
What code did you use to disable Alt + PrintScreen?
Thanks
felgall
01-14-2009, 12:21 AM
Hi Caliban,
What code did you use to disable Alt + PrintScreen?
Thanks
Since it is an intranet the operating system settings on the computer can be changed to disable that function.
For the JavaScript to always work you also need to turn off the access to the browser options/preferences so that the person using the computer can't disable the JavaScript.