Display custom context menu entries for text selection
See original GitHub issueIs your feature request related to a problem? If so, Please describe.
I’d like to be able to run my own code for the text I select on different webpages within the webview via the popup context menu. Currently the possible options there seems to be limited to whatever the default system options are.
Describe the solutions you came up with
Solutions would be to either:
- enable adding of new entries to the default context menu
- showing our own context menu made up only of defined entries
Additional context
- There was this closed, but unresolved, issue on the
react-native
repo with the same idea: https://github.com/facebook/react-native/issues/19111 - The last post in there links to this package to customize context menu entries. It works great for general text, but does not work with
<WebView>
: https://github.com/Astrocoders/react-native-selectable-text - I found some stackoverflow answers detailing how to do this in native code. Alas I am not experienced with native mobile development, and they very well may be not be relevant answers anymore going by the dates. Android (https://stackoverflow.com/a/22391169) and iOS (https://stackoverflow.com/a/3596414).
Thanks for your time, and please let me know if you need any more information.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:7
Top Results From Across the Web
Display custom context menu entries for text selection #647
I'd like to be able to run my own code for the text I select on different webpages within the webview via the...
Read more >Add menu item to windows context menu only for text selection
Someone know where can I add registry key for add some function to the right-click menu only when some text is selected? Such...
Read more >Creating Custom Context Menu Entries - Maple Help - Maplesoft
Creating Custom Context Menu Entries You can customize the entries and actions on a context menu module using the ContextMenu package commands.
Read more >How to customize context menu in Document Editor - Syncfusion
Checkout and learn about Customize context menu in JavaScript DocumentEditor control of Syncfusion Essential JS 2, and more details.
Read more >Custom Context Menu Items - MicroStrategy
Custom Context Menu Items. Custom context menu items can be configured to allow for changes to properties specific to your visualization.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://medium.com/flutter-community/inappwebview-the-real-power-of-webviews-in-flutter-c6d52374209d If you search for “Custom context menus” on this page, it’s possible to do similar things with
https://pub.dev/packages/flutter_inappwebview
in flutter. Maybe there’s a way to borrow some code there and make it work for React Native Webview?Any updates?