Search code examples
androidgoogle-chromemobile-browser

Chrome for Android content access from external app


Is there any way to read page content (html source or DOM) from the active Chrome tab on Android devices?

Chrome for Android doesn't support extensions and there is no plans to implement Extension API on Chrome for Android in the nearest future (however, Chrome for iOS now supports App Extensions).

Some apps (for example, LastPass) can access web content inside web browser.

How can I get read access to the active web page? Are there any external Chrome APIs or something similar?

Any suggestion will be appreciated. Thanks in advance.


Solution

  • It seems to be possible with Android Accessibility. I think the flag you need is FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY, so you can inject JavaScript into the website.

    As you can see in this blog by lastbpass, they use the same approach. In the video at 0:53, you see the accessibility features they use.