HTML5 Context Menu

Discussion in 'HTML & Website Design' started by Orawolf, Dec 13, 2015.

  1. #1
    Hello
    I am struggling with HTML5 context(right click) menu. The following piece of code work only on FIrefox. However, it does not work on IE, Chrome or Safari. How can I have a browser independent functionality for this context menu?

    <div contextmenu="mymenu">
    
    <menu type="context" id="mymenu">
      <menuitem label="Refresh"></menuitem>
      <menuitem label="Search"></menuitem>
    </menu>
    
    </div>
    HTML:
    darsh
     
    Orawolf, Dec 13, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Well... not sure why you have the DIV for nothing, the empty items, the menuitem tag is still in the "working draft" stage and is another pointless redundancy (just another reason IMHO HTML 5 is crap), and generally speaking from a browser security perspective allowing you to override the right click is NOT something that should even be allowed...

    Which is why that doesn't work in FF for me either...

    It's pointless code-bloat redundancies like this that are why even the W3C is starting to wake up and tell the WhatWG where they can shove their "living document" bull.

    This the type of usability rubbish and code bloat asshattery that to be frank, unless you're working on a web crapplication; AND EVEN THEN, just... don't.
     
    deathshadow, Dec 13, 2015 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    Not to mention that without instructions, how is the user even meant to know that functionality exist? Why not use regular buttons (a form) for this? BTW, "refresh" - is that meant to refresh the page? If so, F5 or reload in the browser does that just fine.
     
    PoPSiCLe, Dec 15, 2015 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    There are legitimate scenarios for creating hooks for those -- like when the browser is locked into kiosk mode (if it has one) or if you are making a native web application using something like metro, electron or nw.js

    But at that point you probably wouldn't give a flying purple fish about cross-browser support; whole different set of rules.
     
    deathshadow, Dec 16, 2015 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    True, but if you're in kiosk-mode, usually the right-click menu is removed, or at least severely limited, and often you're on a touch-screen, where right-click often means nothing...
     
    PoPSiCLe, Dec 17, 2015 IP