Disable Chrome paste menu in text input on touch screen

How to disable this annoying context menu in chrome while on the touch screen. This pops up when selecting / with a long press of any input, while I have the text copied.

enter image description here

I am developing an application using CEFSharp (Chromium Embedded Framework) and deploying it on a touch screen on a Windows 8 machine. I am using the on-screen keyboard ( http://mottie.imtqy.com/Keyboard/ ) to enter text into the input fields.

I tried

$('input').bind('copy paste contextmenu', function (e) { e.preventDefault(); e.stopPropagation(); }); 

this disables the insert, but the menu is still displayed. How do I get rid of this menu? what is the best way to do this: CSS, Javascript, or through the chrome command line arguments ( http://peter.sh/experiments/chromium-command-line-switches/ )?

+6
source share
1 answer

I know what you said JS / CSS, but it worked for me

 var browser = new ChromiumWebBrowser("http://www.afrobotics.co.za") { Dock = DockStyle.Fill, DragHandler = new DragHandler(), MenuHandler = new ContextHandler() }; // public class ContextHandler : IMenuHandler { public bool OnBeforeContextMenu(IWebBrowser browser, IContextMenuParams parameters) { return false; } } public class DragHandler : IDragHandler { public bool OnDragEnter(IWebBrowser browser, IDragData dragData, DragOperationsMask mask) { return true; } } 

code>

0
source

Source: https://habr.com/ru/post/989772/


All Articles