View Full Version : Right click disable
melian9102 05-25-2005, 06:05 PM How do I make it so that when people "Right Click" anything on my website, the typical "right click" menu (with view source, save as..) wont show up?
I don't want a little pop up box indicating that right click is disabled, though. I just want this feature to be disabled, without anything popping up.
Thanks.
logo-one 05-25-2005, 06:16 PM add this to the <body> of your page
Change the var Message "Function Disable" to what ever u want
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
empresasdehosting 05-25-2005, 06:18 PM if you use HTML, you can use HTML Protector
http://www.hypergurl.com/htmlProtector.html
melian9102 05-25-2005, 06:21 PM Originally posted by logo-one
add this to the <body> of your page
Change the var Message "Function Disable" to what ever u want
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
Thanks, but I was hoping that a pop-up box would not show up. Would you know how to do this? Thanks.
melian9102 05-25-2005, 06:23 PM Originally posted by empresasdehosting
if you use HTML, you can use HTML Protector
http://www.hypergurl.com/htmlProtector.html
Yes, I do use HTML, but do have CSS and Javascript within the HTML pages. Are these codes protected with this program as well? Have you used this?
Thanks.
the_pm 05-25-2005, 06:37 PM Right clock scripts don't work. You might be able to slow down someone using IE, but if someone cares enough about your page's source to go looking for it, no right-click script is going to stop that person.
All you're doing is forcing people to download needless bytes of information. I'd scrap this idea entirely.
empresasdehosting 05-25-2005, 06:38 PM Yep, it protects all the code you want.
I used it in the past and it worked great.
Try a trial version and then decide if it works for you
DevilDog 05-26-2005, 02:06 PM Hey melian. I'm just curious what you're trying to protect. There may be easier ways to protect certain things than blocking right clicking. If you're trying to mask link info there are better ways. If you don't want people stealing content then disabling right click is not the way to go.
melian9102 05-26-2005, 04:02 PM Originally posted by DevilDog
Hey melian. I'm just curious what you're trying to protect. There may be easier ways to protect certain things than blocking right clicking. If you're trying to mask link info there are better ways. If you don't want people stealing content then disabling right click is not the way to go.
I just dont want people to steal content from the site, such as pictures and graphics.
the_pm 05-26-2005, 04:17 PM Originally posted by melian9102
I just dont want people to steal content from the site, such as pictures and graphics. Then don't post it.
Seriously, I'm not at all trying to sound mean - that's really, truly the only way you're going to stop someone from stealing your graphics, and realizing this will end a lot of silly discussions about functionality that doesn't really function right now.
Theoretically, if you wanted to put every possible obstacle in the way of someone trying to steal your images, you'd need to:
1. Disallow all clicking (mouses are configurable, and many people have custom settings on them.
2. Disallow all keystrokes.
3. Attempt to auto-install an executible program that wipes someone's browser cache the moment they opened the folder.
4. Cover all images with a transparent gif/png.
5. Watermark every image, even site layout images (this is a more serious suggestion - you'd be surprised how creative you can get with watermarking if you practice a little).
6. Disable hotlinking and direct image/image folder access.
7. Disable menu functions that allow people to save Web pages.
8. Do all of these things in all known browsers for PC, Mac, Linux, Sun etc.
Yeah, most of that list isn't going to happen, and many portions are easily defeated by disabling JavaScript. In fact, I believe Firefox by default disallows any JavaScript that attempts to defeat mouse-clicks.
It's a fool's errand. Concentrate more on choosing your imagery wisely and figuring out ways to make it less appealing to thieves (be creative - you don't have to deface your own graphics to do this), rather than trying to devise ways to break people's computers. That's a battle you'll lose every time!
HTH! :)
DevilDog 05-26-2005, 05:05 PM Good post the_pm.
Something you have to consider is that if you put a bunch of obstacles in the way of the user just to protect images then he may think "Fine, it's not worth browsing this site anyhow."
the_pm is right. Unless you disable keystrokes then a person could just print screen. If you disabled that and a person really wanted it they could just look at it and do their best to copy it.
If you're worried about protecting original digital pictures then just don't post anything but scaled down versions and put watermarks on them.
I just can't fathom a site that is so important to protect as to alienate the vast majority of users who would be severely annoyed by the limitations your site imposes on them.
melian9102 05-26-2005, 06:12 PM Geebus!
I just wanted to know how to disable right click, and if there was a way for this to happen without any pop-ups.
I would have been fine with a simply yes or no answer. :emlaugh:
KevinTang 05-26-2005, 06:31 PM theres plenty of ways to disable right clicking, but definitely your best bet is to just watermark your images with a site logo or somethin. Any 2-yr old is going to be able to figure out how to steal an image from a disabled right clicker.
the_pm 05-26-2005, 06:38 PM Originally posted by melian9102
Geebus!
I just wanted to know how to disable right click, and if there was a way for this to happen without any pop-ups.
I would have been fine with a simply yes or no answer. :emlaugh: No
;)
The short answer: There are scripts that purport to protect your content. They fail across the board.
NyteOwl 05-26-2005, 08:04 PM Bottom line is if it displays in the browser it can pretty much be copied given the inclination to to so. Even if it's something as mundane as taking a screenshot and cutting out the part you want :D
Corey Bryant 05-26-2005, 08:43 PM To answer your question, check out No right mouse click script III (no alert) (http://www.dynamicdrive.com/dynamicindex9/noright3.htm) but I have to agree with everyone else - don't put it on the internet if you do not want people to see it etc.
No matter what you do there will always be a way around it. For example, on IE, I use BlazingTools Instant Source (http://www.soft32.com/download_16821.html) - which will show me your source code :)
melian9102 05-26-2005, 09:06 PM Originally posted by the_pm
No
;)
The short answer: There are scripts that purport to protect your content. They fail across the board.
short and simple...that's all i needed to know
NyteOwl 05-26-2005, 09:10 PM No matter what you do there will always be a way around it. For example, on IE, I use BlazingTools Instant Source - which will show me your source code
Haven't seen this, I must have a look. I have used WebWasher which along with doing a fine job filtering popups etc, also filters out javascripts that prevent me doing a right click :)
-T{H}R- 05-28-2005, 11:14 AM Plus if I was a user and right-clicked and nothing happened, that in itself would be enough to annoy me.
|