搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How do I prevent a long press from bringing up the context menu when using a touch screen?

  • 2 回覆
  • 1 有這個問題
  • 166 次檢視
  • 最近回覆由 JonEmagine

more options

Hello, I'm working for a web based POS software company. We normally run our software in Chrome, but use Firefox (v47.0.1, in Windows POS Ready 7, no Add-ons) at about 40 locations because it has solved some weird issues that have come up at those sites (Web Socket disconnect, elements stop showing up on 3rd party hosted pages, etc...). Just had this issue brought to my attention today, and I can't seem to figure out which config setting I need to change. When I press and hold on a menu item, it is bringing up the context menu. Normally our software will open a pop-up window so you could edit or 86 the menu item from this pop-up menu. If I am using a mouse, the behavior works the way it should (left click and hold opens the pop-up menu). I thought this had something to do with "ui.click_hold_context_menus", but I'm still having the same issue when changing the value on this setting.

Hello, I'm working for a web based POS software company. We normally run our software in Chrome, but use Firefox (v47.0.1, in Windows POS Ready 7, no Add-ons) at about 40 locations because it has solved some weird issues that have come up at those sites (Web Socket disconnect, elements stop showing up on 3rd party hosted pages, etc...). Just had this issue brought to my attention today, and I can't seem to figure out which config setting I need to change. When I press and hold on a menu item, it is bringing up the context menu. Normally our software will open a pop-up window so you could edit or 86 the menu item from this pop-up menu. If I am using a mouse, the behavior works the way it should (left click and hold opens the pop-up menu). I thought this had something to do with "ui.click_hold_context_menus", but I'm still having the same issue when changing the value on this setting.

被選擇的解決方法

Hmm, by default, Firefox lets sites override the built-in context menu using the document.oncontextmenu/window.oncontextmenu event. That works with the mouse on desktop and with touch on Android. I don't have a desktop computer with touch to test, but I would expect that to work.

There is a preference to override that behavior so that Firefox's context menu always appears (often in front of the site's context menu): set "dom.event.contextmenu.enabled" to false. However, it seems unlikely you would have toggled that on your systems.

As far as I know, the "ui.click_hold_context_menus" preference is only for Mac users (to address something related to the single mouse button), so that could explain why it makes no difference to the behavior you're describing.

從原來的回覆中察看解決方案 👍 0

所有回覆 (2)

more options

選擇的解決方法

Hmm, by default, Firefox lets sites override the built-in context menu using the document.oncontextmenu/window.oncontextmenu event. That works with the mouse on desktop and with touch on Android. I don't have a desktop computer with touch to test, but I would expect that to work.

There is a preference to override that behavior so that Firefox's context menu always appears (often in front of the site's context menu): set "dom.event.contextmenu.enabled" to false. However, it seems unlikely you would have toggled that on your systems.

As far as I know, the "ui.click_hold_context_menus" preference is only for Mac users (to address something related to the single mouse button), so that could explain why it makes no difference to the behavior you're describing.

more options

Thanks for your suggestion, jscher2000! Is document.oncontextmenu/window.oncontextmenu event set in the site's code? Unfortunately I don't have access to the code, but can forward this suggestion to our programmers. After my post, I tried changing the value of "ui.click_hold_context_menus" to false, but no luck there either.