Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable right mouse button completely - passthison.com does it - how?

Status
Not open for further replies.

raveclub

MIS
Feb 25, 2001
5
US
Hello,

I just found the forum this weekend and it is really great.

I have come across somthing that I have never seem before and are wondering if anyone can completely figure out how it works.

Parts of it I got. It's a script that completely disables the right mouse button of a page, that unloads when you leave the site.

It disables right button for that particular page even when you click on the icon bar at the bottom of the browser.

The page is also a hidden page, as the left and right starting piexel points are set at 5000.

I came across this on the site, passthison.com.

If you go to the home page of the site and then close it a couple of new pages unload, almost simultaneously then another page replaces one of the pages that unloads.

This is the page that the mouse button is disabled on.

The script seems to work because of a dynamic relationship between 2 or more pages on the site.

The code, <HTML XMLNS:IE> appears at the beginning of one of the pages that is part of this relationship.

One interesting aspect of the actual page which can not be clicked on is that it's icon at the bottom of the browser does not contain the internet explorer icon that every other page usually does.

I would really be interested if someone has seen this before and knows how it is done.

Thanks
 
went to passthison.com
the 'no right click' is not completely disabled

try it for yourself:

right click to get the alert - then left click the OK and hold it so the button's pressed - then right click and hold so both mouse buttons are pressed - then let go of left click so alert disappears and then let go right click - there you go - the right click menu

if you want a script that really works - here ya go:

<script language=&quot;JavaScript1.2&quot;>
if(window.Event)
document.captureEvents(Event.MOUSEUP);function nocontextmenu()
{event.cancelBubble=true
event.returnValue=false;return false;}function norightclick(e)
{if(window.Event)
{if(e.which==2||e.which==3)
return false;}else
if(event.button==2||event.button==3)
{event.cancelBubble=true
event.returnValue=false;return false;}}document.oncontextmenu=nocontextmenu;document.onmousedown=norightclick;
</script>

I haven't been able to break this yet
 
Milech,

Hello,

That is real good, it wasn't real long either, that is a real trick.

The only thing that it doesn't do is disable the right button when you click on the icon of the page in the bar across the bottom of the browser.

Thanks for your help.
 
That script didnt seem to work in my netscape 4.6. How about this one.

<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
<!--

document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}

//-->
</script>
 
Spekki,

Hello, that script worked really good too.

The one thing that seems hard to do is to get the right mouse button disabled on icon of the page in the icon bar across the bottom of the browser.

If you notice, the icon for the disabled page does not have the internet expolorer icon within it. That must have something to do with it.

Thanks
 
what icon are you talking about? i dont see any icon. are you talking about the icon next to the word done (in ie)??

or what?? theEclipse
eclipse_web@hotmail.com
**\\||It was recently discovered that research causes cancer in rats||//**
 
My question is why disable the right click in the first place... that is if you do not want people to &quot;steal&quot; your stuff. All anyone has to do is use a new browser like IE 5.5 and related tools... and then just save it in a folder. It saves all the stuff including related graphics in a neat little package. Anyone can do this in a half a milli-second and steal you blind.

Let's support the majority of our customers by giving them a page that they can navigate into and out of and find what they came to get in the first place.
 
jund

If you want to know why the right button is disabled in the first place ask the person who owns passthison.com

He did it not me.

<HTML XMLNS:IE>
 
I happen to agree with jund.

The ability to view the source of a page is a big driving force behind the rapid development of the internet! It certainly helps me as im in the process of learning Javascript at the moment. The internet is a community and as such needs to be willing to share information for the general good of its self. Not become commercialised. Be a platform for commerce yes... but not commercialised in its self.
 
I am just trying to find a way to disable right click myself, not in any attempt to hide my code, rather in the hope that the right click of a custom tag active edit control will be disabled (it would just cause headaches for our tech support department). So if anyone has a simple piece of code that will disable it, at a very basic level that would be great. People who know how to get around it should not have any problems with the functionality I am trying to hide.

Thanks in advance.
Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top