add menu item to context (right-click) menu?

Discussion in 'Javascript' started by lcplben, Oct 30, 2009.

  1. lcplben

    lcplben Guest

    Hi everybody --

    I'd like to add a choice to the context menu for an element. That
    choice might be "Hide this table column" or "Show attributes for this
    element," for example.

    I don't want to replace the whole very-useful context menu, but only
    to augment the thing.

    Can someone tell me (1) if this is possible and (2) if so, where is an
    example?

    This question has appeared in this group four or five times up to a
    couple of years ago, but never answered; perhaps by now an answer has
    surfaced. And it's not in the FAQ.

    Thanks!

    -- ben
     
    lcplben, Oct 30, 2009
    #1
    1. Advertising

  2. lcplben wrote:

    > I'd like to add a choice to the context menu for an element. That
    > choice might be "Hide this table column" or "Show attributes for this
    > element," for example.
    >
    > I don't want to replace the whole very-useful context menu, but only
    > to augment the thing.
    >
    > Can someone tell me (1) if this is possible and (2) if so, where is an
    > example?


    If you write a Mozilla/Firefox extension with XUL and JavaScript then
    your extension can add items to the context menu. Other browsers may
    have different mechanism.

    But if you use script in a HTML document loaded in a browser window then
    your script can't change the context menu the browser pops up.

    --

    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Oct 30, 2009
    #2
    1. Advertising

  3. On Oct 30, 7:53 am, Martin Honnen <> wrote:

    > If you write a Mozilla/Firefox extension with XUL and JavaScript then
    > your extension can add items to the context menu. Other browsers may
    > have different mechanism.


    In Internet Explorer you'd have to play with the registry. I wrote a
    quick tutorial on this here:

    http://www.visualbasicscript.com/tm.aspx?high=&m=27971&mpage=1#27971
     
    Michael Haufe (\TNO\), Oct 30, 2009
    #3
  4. lcplben wrote:
    > Hi everybody --
    >
    > I'd like to add a choice to the context menu for an element. That
    > choice might be "Hide this table column" or "Show attributes for this
    > element," for example.
    >
    > I don't want to replace the whole very-useful context menu, but only
    > to augment the thing.
    >
    > Can someone tell me (1) if this is possible and (2) if so, where is an
    > example?
    >

    Not possible.

    The context menu can be prevented in some browsers.

    Where it can be prevented, an element, such as DIV or LI can be
    shown instead.
    --
    Garrett
    comp.lang.javascript FAQ: http://jibbering.com/faq/
     
    Garrett Smith, Oct 30, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWJkYWxsYQ==?=

    Highlight text and right click for a custom context menu, asp

    =?Utf-8?B?QWJkYWxsYQ==?=, Mar 22, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    714
    Bruce Barker
    Mar 22, 2006
  2. Abdalla
    Replies:
    1
    Views:
    120
    Bob Barrows [MVP]
    Mar 23, 2006
  3. Leon
    Replies:
    3
    Views:
    175
    TaeHo Yoo
    Nov 26, 2004
  4. Replies:
    3
    Views:
    116
  5. FAQ server
    Replies:
    0
    Views:
    1,174
    FAQ server
    Feb 22, 2012
Loading...

Share This Page