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

Discussion in 'Javascript' started by emmajoh, May 2, 2006.

  1. emmajoh

    emmajoh Guest


    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:

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





    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!!!
    emmajoh, May 2, 2006
    1. Advertisements

  2. emmajoh

    Randy Webb Guest

    said the following on 5/2/2006 12:15 PM:
    Another one re-inventing the wheel?
    Hmmm. Uninstall the Google Desktop......
    Most didn't work to start with that messed with the context menu.

    It does? Not for me.
    Randy Webb, May 2, 2006
    1. Advertisements

  3. emmajoh

    McKirahan Guest

    Have you tried:

    <body oncontextmenu="return false">
    McKirahan, May 2, 2006
  4. emmajoh

    emmajoh Guest

    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?
    emmajoh, May 2, 2006
  5. emmajoh

    Randy Webb Guest

    said the following on 5/2/2006 12:41 PM:
    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.

    No. It is not even close. What do you think setting the document.body to
    a reference to a function is supposed to do?
    He didn't if he is trying to over ride the context menu.
    Want an IE only no context menu? Use an .hta
    Randy Webb, May 2, 2006
  6. emmajoh

    McKirahan Guest

    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;

    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.
    McKirahan, May 3, 2006
  7. emmajoh

    julpero Guest

    julpero, May 10, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.