Disabling contextmenu doesn't work in IE since I've installed google bar

E

emmajoh

Hi

I'm trying to disable IE contextmenu (on a right click) as I want to
create my own.
The problem is that since I've installed the latest version of the
google desktop, the script doesn't work.
No other script I found on the Internet is working anymore.

As you can see below, I've tried to catch every event I'm aware of:
___________________________

<html>
<head>
<script language=javascript>
function noRightClick(){
return false;
}

</script>
</head>

<body>


<script>
document.onmousedown=noRightClick;
document.onmouseup=noRightClick;
document.oncontextmenu=noRightClick;
window.onmousedown=noRightClick;
window.onmouseup=noRightClick;
window.oncontextmenu=noRightClick;
document.documentElement.onmousedown=noRightClick;
document.documentElement.onmouseup=noRightClick;
document.documentElement.oncontextmenu=noRightClick;
document.body.onmousedown=noRightClick;
document.body.onmouseup=noRightClick;
document.body.oncontextmenu=noRightClick;
</script>
</body>
</html>

_____________________________________

What else can I do?
Even more frustrating, The new yahoo mail beta manage to do it as it
has its own contextmenu when you right-click on an email...

Help please!!!
 
R

Randy Webb

(e-mail address removed) said the following on 5/2/2006 12:15 PM:
Hi

I'm trying to disable IE contextmenu (on a right click) as I want to
create my own.

Another one re-inventing the wheel?
The problem is that since I've installed the latest version of the
google desktop, the script doesn't work.

Hmmm. Uninstall the Google Desktop......
No other script I found on the Internet is working anymore.

Most didn't work to start with that messed with the context menu.

Even more frustrating, The new yahoo mail beta manage to do it as it
has its own contextmenu when you right-click on an email...

It does? Not for me.
 
M

McKirahan

Hi

I'm trying to disable IE contextmenu (on a right click) as I want to
create my own.
The problem is that since I've installed the latest version of the
google desktop, the script doesn't work.
No other script I found on the Internet is working anymore.

As you can see below, I've tried to catch every event I'm aware of:

Have you tried:

<body oncontextmenu="return false">
 
E

emmajoh

I have tried that now but it doesn't work
I though writing <script>document.body=noRightClick;</script> was
the same anyway (where the function noRightClick() returns false).

McKirahan, I just saw you had a similar problem a while ago (it only
worked whith an alert() in the function).
How did you manage to solve your problem?
 
R

Randy Webb

(e-mail address removed) said the following on 5/2/2006 12:41 PM:
I have tried that now but it doesn't work

What doesn't work?

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

I though writing <script>document.body=noRightClick;</script> was
the same anyway (where the function noRightClick() returns false).

No. It is not even close. What do you think setting the document.body to
a reference to a function is supposed to do?
McKirahan, I just saw you had a similar problem a while ago (it only
worked whith an alert() in the function).
How did you manage to solve your problem?

He didn't if he is trying to over ride the context menu.
Want an IE only no context menu? Use an .hta
 
M

McKirahan

[snip]
I just saw you had a similar problem a while ago (it only
worked whith an alert() in the function).
How did you manage to solve your problem?

I presume your referring to my post of 08/24/2004
with a Subject of "Disable right-click without alert?".
(Randy Webb's responses were very informative.)

If you're referring to this code:

<script type="text/javascript">
function click() {
if (event.button == 2) alert("right-click disabled.");
}
document.onmousedown = click;
</script>

it does not disable right-click.

Try it but continue to hold the right mouse button
down and press Enter to acknowledge the alert().
The context menu will then be displayed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top