Link to home
Start Free TrialLog in
Avatar of ziffgone
ziffgoneFlag for Canada

asked on

Automatically Clear ClipboardData in Netscape

Good day experts, I have a bit of script that I'm using that, when someone selects some text or an image on my page and copies it to their Clipboard, the clipboard is automatically cleared in a set amount of time. Therefore, when they take the text or image to an editor of their choice and try pasting it, it no longer is in their clipboard to paste.

Anyway...the code I have works for IE but not for Netscape. Does anyone know how I can convert or create a sister script that'll work in Netscape?

Existing IE only Code:

function ccb(){
if(clipboardData){
clipboardData.clearData();
}
}
setInterval("ccb();", 1000);

This script clears the clipboard after one second.
SOLUTION
Avatar of devic
devic
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ziffgone

ASKER

<font color="red">venkateshwarr</font> - I'm basically trying to disable the "Print Screen" funtion. When you hit the Print Screen button, it stores the image in your Clipboard. The IE script dumps the clipboard after a second after anything is applied to the clipboard, so it works.

I'm not sure how I can make -- <font color="red">window.clipboardData.setData('text','')</font> -- capture this event? Does it not simply replace the 'text' value with ' '? How can I assign the whole window as the 'text' value? Any Ideas?

<font color="red">Devic</font> - Not sure what I need to parse out of there to get what I need. I'm not experienced enough with javascript to understand what's all happening with the script shown at that site you supplied.

Thanks for any more help you guys can give...
Sorry for the Sloppy HTML code in the above Comment, wasn't aware it was not accepted in these forums, and apparently there is not an option to be able to Edit your comments. Whoops.
Avatar of apprenti
apprenti

www.cosdreamer.com uses this sort of technique, and the "protected" stuff doesn't show up in Netscape at all.
apprenti - Hence the reason I'm looking for a Netscape variant. I'd then set up a Browser specific if/else statement.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial