Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get content of WebView with accessibility features of android?

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.

like image 629
vehumet Avatar asked Nov 13 '22 20:11

vehumet


1 Answers

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.

like image 58
Vijay Vankhede Avatar answered Nov 15 '22 12:11

Vijay Vankhede