Jump to content
xisto Community
wannabeeaweak

Javascript: Disable Mouse Right-click In Browser

Recommended Posts

just copy and paste this on to your html site in the head tag

<script language="JavaScript"><!--/**/var message="Hey YOU!\nStop Stealing my pictures or\nFACE THE PUNISHMENT!" function click(e) {if (document.all) {if (event.button == 2) {alert(message);return false;}}if (document.layers) {if (e.which == 3) {alert(message);return false;}}}if (document.layers) {document.captureEvents(Event.MOUSEDOWN);}document.onmousedown=click;// --> </script>

Edited by microscopic^earthling (see edit history)

Share this post


Link to post
Share on other sites

or just add this to your body tag:

oncontextmenu="return false"
that will stop right-click in IE. It won't return a message but it does stop this. I have given this out before in another topic along with a couple more pieces for all those who still want to use it(i see no reason to). I have also stated that it will not work in Firefox(any version), it only works in IE.

Share this post


Link to post
Share on other sites

this doesnt work in most browsers.. and even if it did, it doesnt stop people from clicking "View source" and EEEVEN if it did that, then it wouldnt stop people getting the source with telnet.this code is useless, sorry, and its been poted many times already by other people.

Share this post


Link to post
Share on other sites

i dont know if it is important to stop your right-click in IE, as for me i dont use it,everytime when i want to copy or paste somethings , use right-click is very good, but use right-click it will block somethings,just like when someone want to view your site's source code, so i dont use right-click!

Share this post


Link to post
Share on other sites

but it will not stop people (most of them anyway) there are ways around it like using a different browser, or you could just save the page and view the html from the saved pages (right-click the document and click open with Notepad, or something like that). Sorry to say that.

Share this post


Link to post
Share on other sites

This is important for someone to keep safe their product which they use to get money. See the following link: http://forums.xisto.com/no_longer_exists/

However, I don't know how to achieve this, as I could not open the link in a new window, and don't know how to save the html.

Share this post


Link to post
Share on other sites

How to desable right click while opening new window?

Javascript: Disable Mouse Right-click In Browser

 

Hi,

 

 

 

I know how to desable right click in winow but I am unable to desable right click in new window.When ido I click on link and open a new window.

 

 

 

Pls reply..

 

 

 

Please do the needful.

 

 

 

-Amit Tiwari

Share this post


Link to post
Share on other sites

Can it work with Safari?

Javascript: Disable Mouse Right-click In Browser

 

Does the code works for Safari? Coz I heard there are quiet a few codings that did have any effect with Safari.

 

-reply by dSpy

Share this post


Link to post
Share on other sites

How to desable right click while opening new window?

 

java script: Disable Mouse Right-click In Browser

Hi,

I know how to desable right click in winow but I am unable to desable right click in new window.When ido I click on link and open a new window.

Pls reply..

Please do the needful.

-Amit Tiwari

I don't understand completely but in case the new window is yours then you must copy the code to it also, by yours i mean that you are the owner -the one who makes the page- of the opener and of the new window.

 

And, i don't know if it works with Safari because i don't use it.

 

Best regards,

Share this post


Link to post
Share on other sites

This is not only an annoying measure, it also cripples deeply usability. Not to say that nowadays with the steady growth of alternate browsers, mostly Firefox, Safari and Opera, it simply won't work. It's VERY hard to "hide" things like HTML/CSS/JS code from a curious or bad intentioned reasonably intelligent person.I'd say this one is a big no-no.

Share this post


Link to post
Share on other sites

Don't forget about the PrintScreen button on your keyboard.Disabling right-click could be useful, but it won't protect your images.Put in a water-mark and maybe decrease the resolution to a preview edition to protect your images.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.