|
|
|
01-31-2003, 10:33 AM
|
Postid: 81348
|
|
Registered User
Join Date: Nov 2001
Location: Virginia, USA
Posts: 117
|
Preventing right-click menu in Netscape
I'm clueless when it comes to Javascript, but I'm trying to use code which I've copied and pasted into my HTML, and need some help. I'm implementing the following Javascript in order to prevent the right-click menu sometimes used to save images to a local drive. While I realize it's not foolproof, it does at least make such practices more difficult.
The code works just fine in IE, but I notice it has no effect in Netscape. Is there any way to do this so that it will also prevent Netscape users from bringing up the right-click menu?
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var sorry="Sorry, you do not have access to this feature."
function click(e)
{
if (document.all)
{
if (event.button == 2)
{
alert(sorry);
return false;
}
}
if (document.layers)
{
if (e.which == 3)
{
alert(sorry);
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//-->
</SCRIPT>
Any suggestions would be greatly appreciated.
|
|
|
01-31-2003, 10:41 AM
|
Postid: 81350
|
|
Service Rep
Join Date: Dec 1999
Location: Jacksonville, Fl
Posts: 4,881
|
|
|
|
01-31-2003, 12:20 PM
|
Postid: 81357
|
|
Registered User
Join Date: Nov 2001
Location: Virginia, USA
Posts: 117
|
Thanks, Bob. I tried the code at the above link, it disables the right-click in IE, but again, in Netscape (even though it displays a message that right-click is disabled) the menu pops up anyway.
Any other ideas?
|
|
|
01-31-2003, 12:31 PM
|
Postid: 81358
|
|
Service Rep
Join Date: Dec 1999
Location: Jacksonville, Fl
Posts: 4,881
|
Hi again,
This code seems to work a tad better in the Newer Netscape and Mozilla browsers:
http://javascript.internet.com/page-...ges-click.html
You still can view the page source but right-clicking save image as seems to be prevented, at least superficially.
This article pretty well says it all in regards to preventing right click however....
http://www.webmasterbase.com/article/748
Good luck,
Bob
|
|
|
01-31-2003, 01:32 PM
|
Postid: 81359
|
|
Site Owner
Join Date: Aug 1999
Location: Metro Los Angeles Area
Posts: 7,398
|
I am someone who uses right click extensively. I like to use it to easily open links in new browser windows or tabs. I use it to copy and paste. I use it for all kinds of stuff.
Sites that disable right-click do more than prevent saving of files. They make it difficult for me to easily navigate their site.
I usually don't visit such sites twice. Just my $0.02.
|
|
|
01-31-2003, 01:52 PM
|
Postid: 81360
|
|
Site Owner
Join Date: Apr 2002
Location: San Antonio, Texas
Posts: 7,204
|
I agree with Sheila. I right click a lot and sites that prevent it don't stop me they just annoy me.
If it is an image or text that I really want I will get it regardless--even though I'm not one who collects many images or reuses them in unethical ways.
Another 2 cents...
Andi
|
|
|
01-31-2003, 01:54 PM
|
Postid: 81361
|
|
Someone who likes orange
Join Date: Apr 2001
Location: Portland, OR, USA
Posts: 770
|
Quote:
Originally posted by sheila:
I usually don't visit such sites twice.
|
Quite.
One of my friends is a web developer. He is of the opinion that disabling the right click menu is a good idea, and I've had many very spirited arguments with him about why it's such a bad idea. I would readily concede that a primary reason why I did not visit his MC server was because the context menu was disabled.
__________________
--
Dunx
|
|
|
01-31-2003, 03:10 PM
|
Postid: 81363
|
|
Site Owner
Join Date: Apr 2001
Location: Bebe, Texas
Posts: 305
|
Another vote against disabling right click.
I navigate a lot by right click (and some shift/control clicks). It is very annoying to not have them work. I very rarely ever save a picture/graphic, but it is trivial to get around it most of the time. Doesn't slow me down much, just agravates.
Additionally, I bookmark sites by rightclicking links often. Those bookmarks will be lost.
Anyway, measure the cost of having somebody "steal" the graphic versus the lost opportunity cost of annoying visitors into abandoning future visits.
-g
|
|
|
01-31-2003, 03:40 PM
|
Postid: 81365
|
|
Registered User
Join Date: Nov 2001
Location: Virginia, USA
Posts: 117
|
I understand everyone's feeling about the right-click menus, I use it myself, in fact. On the other hand, there *are* people out there that use it to save images when they should not. (BTW, these particular images are not a part of the main site, they are on a page separate from the site content, and are placed there solely to be used as "smilies" within the message board. There is no need to open a separate window or view the source.)
So how do we protect images? I've done the .htaccess thing to substitute a "used without permission" image when they are linked from another site. But I just recently had a disgruntled ex-message board member save some 52 copyrighted images, then upload them to a site of his own and post a public "come and get them" link on another message board.
What then are we supposed to do? Wait until someone violates a copyright and then take legal action? Is there no good way to protect the images without inconveniencing the majority of your users?
And what about browser caching? Am I just spitting in the wind here?
|
|
|
01-31-2003, 03:55 PM
|
Postid: 81368
|
|
Site Owner
Join Date: Apr 2002
Location: San Antonio, Texas
Posts: 7,204
|
Quote:
|
Am I just spitting in the wind here?
|
Yep.
The people who are going to steal your images will not be deterred by disabling right-clicks. Browser cache and screen capture make this a useless remedy, and one that will drive away your legitimate visitors.
Quote:
|
Is there no good way to protect the images without inconveniencing the majority of your users?
|
I don't think so.
It is a familiar problem that predates the internet by centuries. One cannot promote something and hide it from thieves at the same time.
Good Luck, if you come up with a good solution please post it here.
Andi
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 06:22 PM.
|
| |
|
|
|