TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why don't web apps make use of right click?

8 pointsby catskullover 8 years ago
I only recently found out about &quot;oncontextmenu&quot;, which is a javascript event that fires when a user right clicks a web page. Using that event, you can prevent the OS&#x2F;browser right click menu, and even create your own menu.<p>So my question is: why don&#x27;t more web apps make use of that? A right click is an operation that&#x27;s instilled in many (all?) computer users, why not leverage that instead of having complicated dropdown options menus?

12 comments

yakultover 8 years ago
One problem is usually you have to disable the built-in menu. The built-in menu does some pretty important things and as an end user I basically never want it disabled.
评论 #12549220 未加载
评论 #12544634 未加载
garyadamshannonover 8 years ago
Answer: How do you right click on a phone?<p>A proportion of people are designing mobile first, desktop displays are second priority.
评论 #12546349 未加载
wingerlangover 8 years ago
Thank god they don&#x27;t. I hate it when I try to right click to do something and I get some custom control with like one or two options I don&#x27;t even want.
robgibbonsover 8 years ago
Oftentimes, web users are already habituated to the use of default right-click context menus in browsers, at least for most web pages. Oncontextmenu is certainly great for some applications, which is why it&#x27;s there, but it can damage usability if it&#x27;s abused.<p>Whenever I visit a site with right-click events, I think back to the early days of the web, when webmasters tried to prevent you from viewing their source by capturing right-clicks (then you just had to use the menu bar).
_RPMover 8 years ago
It&#x27;s been in use since the 90&#x27;s people would attach the event to images, and assert copyright in an alert dialog on the event callback:<p><pre><code> Array.prototype.forEach.call(document.getElementsByTagName(&#x27;img&#x27;), function(value) { value.oncontextmenu = function() { alert(&quot;Get off my lawn!&quot;); } });</code></pre>
评论 #12557595 未加载
评论 #12545593 未加载
p333347over 8 years ago
It is bad form to block default UI,and it will only annoy and anger your users. The solution to this is to append your own menu to the default context menu. However, this cannot be done AFAIK. Probably a standard that allows that would be something worthy of consideration. So the only way to deal with this is custom UI elements. (As a Windows desktop developer moving to web development, I was quite dismayed that I couldn&#x27;t simply get menu handle and append. In general, moving to straight jacketed webapps from desktop background where almost everything was possible was quite frustrating and painful.)
评论 #12550789 未加载
Cozumelover 8 years ago
You answered your own question, &#x27;I only recently found out about &quot;oncontextmenu&quot;&#x27;, not a lot of people (outside of tech) seem to know about it, also not everyone uses a mouse!
raquoover 8 years ago
UI needs to be predictable and discoverable, right click on web pages is neither. People in general either don&#x27;t use right click, or expect the browser context menu to show up. So if you hide important UI controls behind right click, many users won&#x27;t find them.
csallenover 8 years ago
I believe it&#x27;s a cycle: Web developers don&#x27;t make use of right-clicking, so users don&#x27;t expect to use it and never try, so web developers don&#x27;t use because it&#x27;s not discoverable, and so on.
andriesmover 8 years ago
We make use of right-clicks EXTENSIVELY, almost any and everything in TaskPutty.com is clickable.<p>Of course our app is designed to make every single widget or thing user modifiable and configurable.
marpstarover 8 years ago
1. It&#x27;s extra work that only &quot;power users&quot; will benefit from. 2. No support on mobile?
_RPMover 8 years ago
Google Drive makes use of `oncontextmenu` and also Outlook does too.