Can I get WebView content with Android accessibility features?

I am creating a simple application that adds a sound effect to another game application, and this game works in a hybrid application containing WebView .

I want the contents of the WebView know the context of the game, but it looks impossible even with accessibility features.

I use JellyBean , so I turned on the Enhanced Android Accessibility parameter and launched a review for testing, but it could not only read the contents of the WebView, but also break this game application.

I think that if I could embed javascript that outputs the full html source for the accessibility service, it would be easy to understand the context. I heard that the Enhanced Android Accessibility option does a similar job.

My question is: is it possible to get WebView content with accessibility features?

In particular, can I insert a simple javascript that provides a source of WebView content?

Thanks so much for reading.

+4
source share
1 answer

If you want to access webview above api level 18. Then you should use android:canRequestEnhancedWebAccessibility . After enabling the accessibility service for the Web, you can embed javascript in the webview and access the contents of the web content.

+1
source

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


All Articles