PDA

View Full Version : Disable Right Click or change Right Click options



ckevin
August 6th, 2002, 23:03
I have searched some JavaScripts for Disable Right Click on all browser area or just on image area. However, I need some JavaScripts that can disable people to right click in all broswer area but NOT IMG tags, so that people can right click and save or print that image with other IE statndard right click options.

If it can't be achieved, is it possible to customize the right click option, so that people can only save, print the image?

Thank you!

spork
August 7th, 2002, 06:17
i think the first thing you asked for might be kind of hard or impossible... the second shouldn´t be too hard to do with a custom right click menu...

scripts like that usually have some browser compatability issues though...

agiantdwarf
August 7th, 2002, 16:04
http://www.webmasterbase.com/article/748

biggulp
August 8th, 2002, 00:23
i wouldn't like such a script

Who?
August 8th, 2002, 00:30
i hate it when people disable right clicking because i like to open links up it in to windows


also if your doing this to stop people from viewing your source code, it wont work.

invisionz
August 8th, 2002, 00:42
hehe :)

You can't stop someone who wants something badly - trust me on this one..

Its funny, people put bars on their windows (houses), and still get robbed.

Daniel
August 8th, 2002, 01:00
You do know that people can still see your source and all by going to View>Source, right? ;)

jmiller
August 8th, 2002, 02:11
Originally posted by Daniel
You do know that people can still see your source and all by going to View>Source, right? ;) Still ways of disabling that.
Though there was some mad code in the last issue of 2600, spring 2002 I think it was. Crazy code about right click supression. :rolleyes:

ckevin
August 8th, 2002, 03:04
Normally, I won't use those "Disable Right Click" feature in my personal site, I also think it's annoying. However, I'm working a small scripts that need this feature - can save / print wallpaper but can't view my source (prevent hot linking etc. | Visitors cannot View>Source because I restrict them to open a new browser without Menu Bar, otherwise, they can't enter to the page), Since my script is written in PHP, I don't know how to encode the frontend HTML. Any idea?

Thanks for your idea and links! :)

Blank Verse
August 8th, 2002, 03:35
http://www.freewebspace.net/forums/showthread.php?s=&threadid=30720

Read that, and ask yourself how badly you need to disable the right clicking option.

Canuckkev
August 8th, 2002, 18:16
Don't bother with Javascript. If someone wants your code, then can get at it. If you are worried about hotlinking, .htaccess can stop that.

agiantdwarf
August 9th, 2002, 21:30
You could use .htaccess for hotlinking, and a PHP script that automatically watermarks your images.