Chrome for Android content access from external app - android

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.

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.

Related

Is it possible to emulate Kotlin android Android with a browser?

I am looking forward to create an Android app with Kotlin.
But I can not use Android Studio or other IDEs. I am using the Amazon AWS Cloud9 IDE now.
I have found there is WebView and read articles, but I still cannot figure out how it works.
It is possible to emulate the UI on the web or is it only for web application development?
The WebView framework allows you to specify viewport and style properties that make your web pages appear at the proper size and scale on all screen configurations for all major web browsers. You can even define an interface between your Android app and your web pages that allows JavaScript in the web pages to call upon APIs in your app—providing Android APIs to your web-based application.
Consider using these alternatives to WebView if your app falls into the following use cases:
If you want to send users to a mobile site, build a progressive web app (PWA).
If you want to display third-party web content, send an intent to installed web browsers.
If you want to avoid leaving your
app to open the browser, or if you want to customize the browser's
UI, use Chrome Custom Tabs.
More details

Android Questions about Mozilla GeckoView

I am a beginner Android developer.
I using the 'WebView' had tried to make a Android App.
However, the speed of the web is too slow.
So the Internet search results found GeckoView.
But homepage has been difficult for me to understand I do not know English well.
My questions:
Can I use GeckoView instead of the WebView? Is it simple?
Can I use a code library that just adds to the 'build.gradle' in Android Studio?
Is there another altenative?
Yes, you can use GeckoView also....
Android WebView is not intended for building browser application because, many advanced Web API'S are disabled.
And different phones might have different versions of WebView all of which your app has to support....
Geckoview is open source library that allows you to render web content on Android using the Gecko web engine...
I made simple application with webview, just check out you'll get some help
https://github.com/malikhimani21/Project-2
In some cases, a WebView is a good option for displaying trusted first-party access to your web pages from either a browser or your own app
check out this link
https://developer.android.com/guide/webapps
Gecko view is only experimental. You can't use for production
https://wiki.mozilla.org/Mobile/GeckoView
So your only choice would be a webview. If you are great in javascript, I would recommend you to use react-native. This is how facebook is made, and you can follow extensive documents mentioned here.
https://facebook.github.io/react-native/

Is it possible to run code on all pageloads on Chrome Mobile on Android?

I'm looking to add some very basic functionality to all pages that are opened on Chrome on Android.
Just something very basic like if an url contains X, insert this HTML.
Is there any way this is possible? I'm coming from iOS and hoping that since Android is more open there's a way to add this functionality.
Short answer: No.
Slightly longer answer: The Chrome Extension API on Desktop lets you do this, but there is no Chrome Extensions API on Chrome for Android so it is not possible.

Android native code from web browser using javascript

Is it possible to access android native code using javascript in the default android browser?
Regards,
Dom
No, sorry.
You can create your own Android app that exposes Java objects to WebKit through the WebView widget. Also, you can link to Android apps from your Web content displayed "in the default Android browser" (whatever that might be for the user). And, you can arrange to have an app that you write respond to URLs that otherwise might go to a browser. But that's about it.

Accessing the currently displayed website of the Android browser

is it possible to programmatically access the website that is currently displayed within the Android browser?
As far as I know the native Browser doesn't handle plugins (please correct me if I'm wrong), so I thought that reading the browser cache would be an option.
Is there a more sophisticated way to get the currently displayed HTML?
Thanks in advance!
S.
is it possible to programmatically access the website that is currently displayed within the Android browser?
That would be a security violation, so, no. Also bear in mind that there are several Web browsers for Android.
As far as I know the native Browser doesn't handle plugins (please correct me if I'm wrong)
The standard browser app supports plugins, but not ones downloaded on the fly. So, for example, it supports the Flash plugin (on Android 2.2+), but you have to install Flash separately first.

Categories

Resources