Disable Mobile Chrome 43's "touch To Search" Feature Programmatically
Solution 1:
This can be manipulated in a number of ways. The user can turn it off in flags as PaulI suggested, and you can control it.
Developer control, right now there are a couple of options but the basic summary is if we think it is an user interactable element then it won't be enabled:
- CSS:
-webkit-user-select: none;
- HTML:
- Anything with an
aria-role
will not have the touch to search enbabled - Anything with a
tabindex
of -1 or > 0
- Anything with an
Solution 2:
Possible workaround could be to wrap text in <button>
tag. This obviously wouldn't work if talking about big blocks of text, but for other elements like titles, icons and other small stuff this works fine.
Solution 3:
As of 2021, it isn't possible to disable touch-to-search (when this is triggered by a long-press for text selection) in chrome mobile. The article that Kinlan is referencing is apparently concerned only with touch-to-search triggered through a tap gesture.
Quoting donnd, from bugs.chromium.org:
Regarding #2 -- developer control: The 2015 article that you mentioned (https://developers.google.com/web/updates/2015/10/tap-to-search) focuses on triggering through the tap gesture. As you correctly point out, it does not address the long-press gesture triggering. Touch to Search responds to both tap and long-press but treats them differently. As I'm sure you know, the long-press gesture activates a whole set of features which can include copy, translation, smart text selection, and Web Search. A site developer can markup their page text as non-selectable in order to disable the long-press gesture entirely, but currently there's no way to disable only the Touch to Search response to long pressing. If you'd like to work with us to add such a feature, let us know and we'll file a separate feature request.
Solution 4:
If you want disabled "touch to search" in a menu that has an action open / close (toggle), it is necessary to javascript :
event.preventDefault();
Solution 5:
Navigate to about:flags
or chrome:flags
and look for Enable Contextual Search
Then toggle to Disabled and hit restart at the bottom.
Post a Comment for "Disable Mobile Chrome 43's "touch To Search" Feature Programmatically"