I am building a simple app that adds sound effect to other game app, and that game is running in hybrid app that contains WebView
.
I want to get the contents of WebView
to be aware of the context of game, but it looks impossible even with accessibility features.
I'm using JellyBean, so enabled Enhanced Android Accessibility
option and ran talkback for testing, but it couldn't only read content of WebView but also crashed that game app.
I think if I could inject javascript that outputs full html source to accessibility service, it would be easy to aware context. I heard that Enhanced Android Accessibility
option does similar work.
My question is, is it possible to get WebView contents with accessibility features?
And specifically, can I inject a simple javascript that provides source of WebView contents?
Big thanks for reading.
If you want to access webview above api level 18. Then you should use android:canRequestEnhancedWebAccessibility
. After enabling accessibility service for Web you can inject javascript into webview and can get access of webview content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With