Solved

Automatically Clear ClipboardData in Netscape

Posted on 2004-04-10
7
825 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:ziffgone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Assisted Solution

by:devic
devic earned 100 total points
ID: 10796567
hi ziffgone,

check this:
===============
http://www.krikkit.net/howto_javascript_copy_clipboard.html
0
 
LVL 12

Assisted Solution

by:venkateshwarr
venkateshwarr earned 100 total points
ID: 10796568
Did you try
 window.clipboardData.setData('text','')
0
 
LVL 14

Author Comment

by:ziffgone
ID: 10800986
<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...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Author Comment

by:ziffgone
ID: 10801068
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.
0
 
LVL 4

Expert Comment

by:apprenti
ID: 10801147
www.cosdreamer.com uses this sort of technique, and the "protected" stuff doesn't show up in Netscape at all.
0
 
LVL 14

Author Comment

by:ziffgone
ID: 10801235
apprenti - Hence the reason I'm looking for a Netscape variant. I'd then set up a Browser specific if/else statement.
0
 
LVL 4

Accepted Solution

by:
apprenti earned 100 total points
ID: 10801934
The technique isn't worth bothering with. Cosdreamer's method uses script encoding plus clipboard clear plus empty gif and it still isn't effective in M$. It "works" in NS because there's no image to see or copy to the clipboard.

Moral: the best way to "protect" images is to
1. put a visible copyright on them, and
2. keep the size down.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Provide the IDEA of External JS 1 42
Clear input text 15 27
Javascript Regex 7 20
Asp response.write to clients 6 35
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question