Autofill in browsers on Android P #231

Closed
opened 2025-11-07 08:31:50 -06:00 by GiteaMirror · 36 comments
Owner

Originally created by @szale9001 on GitHub (Jun 4, 2018).

Android P, which is currently in Beta, now allows apps to take advantage of the Autofill framework in browsers without using a full Accessibility service. It requires that both the browsers and apps update things to take advantage of this.

Currently, bitwarden autofill DOES work in android P, but only in apps. So, I wanted to post some info I found with regards to getting autofill working in browsers to since using the autofill framework is always going to be better than using the accessibility service. I hope it can be implemented!

https://blog.dashlane.com/android-p-autofill/
https://developer.android.com/preview/features/autofill#compat-mode

I'm signed up for the bitwarden Android beta and running Android P, so if you make any changes and would like some feedback, I would be happy to help.

Originally created by @szale9001 on GitHub (Jun 4, 2018). Android P, which is currently in Beta, now allows apps to take advantage of the Autofill framework in browsers without using a full Accessibility service. It requires that both the browsers and apps update things to take advantage of this. Currently, bitwarden autofill DOES work in android P, but only in apps. So, I wanted to post some info I found with regards to getting autofill working in browsers to since using the autofill framework is always going to be better than using the accessibility service. I hope it can be implemented! https://blog.dashlane.com/android-p-autofill/ https://developer.android.com/preview/features/autofill#compat-mode I'm signed up for the bitwarden Android beta and running Android P, so if you make any changes and would like some feedback, I would be happy to help.
Author
Owner

@kspearrin commented on GitHub (Jun 5, 2018):

Thanks for the info. Unfortunately we will have to wait until Xamarin releases support for android p before I can begin working on this.

Also, we support autofilling in Oreo on a few browsers like Firefox Focus and DuckDuckGo. Do you know if these work in Android P?

@kspearrin commented on GitHub (Jun 5, 2018): Thanks for the info. Unfortunately we will have to wait until Xamarin releases support for android p before I can begin working on this. Also, we support autofilling in Oreo on a few browsers like Firefox Focus and DuckDuckGo. Do you know if these work in Android P?
Author
Owner

@szale9001 commented on GitHub (Jun 5, 2018):

I understand.

Also, I dl'ed Firefox focus, and I got an autofill prompt, so I think you're good there. Hoping you can get things working for chrome, when xamarin updates. And thanks for the app/service. Really enjoying it.

@szale9001 commented on GitHub (Jun 5, 2018): I understand. Also, I dl'ed Firefox focus, and I got an autofill prompt, so I think you're good there. Hoping you can get things working for chrome, when xamarin updates. And thanks for the app/service. Really enjoying it.
Author
Owner

@fredgolightly commented on GitHub (Aug 7, 2018):

9 is released in preview form - will this allow you guys to work on Android P autofil?
https://blog.xamarin.com/xamarin-android-9-0-p-preview/

@fredgolightly commented on GitHub (Aug 7, 2018): 9 is released in preview form - will this allow you guys to work on Android P autofil? https://blog.xamarin.com/xamarin-android-9-0-p-preview/
Author
Owner

@szale9001 commented on GitHub (Aug 16, 2018):

Just wanted to follow up on this. Is this possible with the xamarin P preview release? Or will you be waiting for stable channel?

@szale9001 commented on GitHub (Aug 16, 2018): Just wanted to follow up on this. Is this possible with the xamarin P preview release? Or will you be waiting for stable channel?
Author
Owner

@kspearrin commented on GitHub (Aug 16, 2018):

Sounds like it is. I have not got around to installing the preview yet though.

@kspearrin commented on GitHub (Aug 16, 2018): Sounds like it is. I have not got around to installing the preview yet though.
Author
Owner

@Mentis commented on GitHub (Sep 2, 2018):

It was released: https://developer.xamarin.com/releases/android/xamarin.android_9/xamarin.android_9.0/

@Mentis commented on GitHub (Sep 2, 2018): It was released: https://developer.xamarin.com/releases/android/xamarin.android_9/xamarin.android_9.0/
Author
Owner

@szale9001 commented on GitHub (Sep 3, 2018):

Very exciting! Just fyi @kspearrin, looks like they moved the documentation here. It's not longer at the link the in the first post.

https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode

@szale9001 commented on GitHub (Sep 3, 2018): Very exciting! Just fyi @kspearrin, looks like they moved the documentation here. It's not longer at the link the in the first post. https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode
Author
Owner

@kspearrin commented on GitHub (Sep 3, 2018):

Thanks, I'll update soon and check it out.

@kspearrin commented on GitHub (Sep 3, 2018): Thanks, I'll update soon and check it out.
Author
Owner

@kspearrin commented on GitHub (Sep 3, 2018):

Tried this out today following the instructions from their docs here:
https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode

I have compatibility mode set like:

<?xml version="1.0" encoding="utf-8" ?>
<autofill-service xmlns:android="http://schemas.android.com/apk/res/android">
  <compatibility-package android:name="com.android.chrome" android:maxLongVersionCode="1000000000"/>
  <compatibility-package android:name="com.opera.browser" android:maxLongVersionCode="1000000000"/>
</autofill-service>

Tried both Opera and Chrome, yet I get no OnFillRequest event in the autofill service...

@kspearrin commented on GitHub (Sep 3, 2018): Tried this out today following the instructions from their docs here: https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode I have compatibility mode set like: ``` <?xml version="1.0" encoding="utf-8" ?> <autofill-service xmlns:android="http://schemas.android.com/apk/res/android"> <compatibility-package android:name="com.android.chrome" android:maxLongVersionCode="1000000000"/> <compatibility-package android:name="com.opera.browser" android:maxLongVersionCode="1000000000"/> </autofill-service> ``` Tried both Opera and Chrome, yet I get no `OnFillRequest` event in the autofill service...
Author
Owner

@kspearrin commented on GitHub (Sep 3, 2018):

Commit with updates: 4f0ea44078

@kspearrin commented on GitHub (Sep 3, 2018): Commit with updates: https://github.com/bitwarden/mobile/commit/4f0ea440784d01a815b563d54605aa9ed4ed8880
Author
Owner

@szale9001 commented on GitHub (Sep 3, 2018):

Hmm, I'm honestly not really a programmer so I'm not sure why it wouldn't have worked. I tried searching github though but really only found this:
03c9e1de1b
Not sure if it might help, and it looks somewhat similar to what you did. That said, I would be happy to test a beta and report back (I'm in that channel on the Play Store and running Pie on a Pixel 2)

@szale9001 commented on GitHub (Sep 3, 2018): Hmm, I'm honestly not really a programmer so I'm not sure why it wouldn't have worked. I tried searching github though but really only found this: https://github.com/googlesamples/android-AutofillFramework/commit/03c9e1de1b1a30a020282415b81f9996a0e9dba2 Not sure if it might help, and it looks somewhat similar to what you did. That said, I would be happy to test a beta and report back (I'm in that channel on the Play Store and running Pie on a Pixel 2)
Author
Owner

@kspearrin commented on GitHub (Sep 4, 2018):

I'm not sure what could be wrong. Maybe I need to update to Android Support libraries v28 as well, but those don't seem to be available for Xamarin yet.

@kspearrin commented on GitHub (Sep 4, 2018): I'm not sure what could be wrong. Maybe I need to update to Android Support libraries v28 as well, but those don't seem to be available for Xamarin yet.
Author
Owner

@kspearrin commented on GitHub (Sep 5, 2018):

If you want to try the dev build apks with the compat mode enabled on a device, you can download them from here: https://ci.appveyor.com/project/bitwarden/mobile/build/artifacts

I don't have a device that can run Android P, so I was only testing on a simulator. Maybe there is a difference?

@kspearrin commented on GitHub (Sep 5, 2018): If you want to try the dev build apks with the compat mode enabled on a device, you can download them from here: https://ci.appveyor.com/project/bitwarden/mobile/build/artifacts I don't have a device that can run Android P, so I was only testing on a simulator. Maybe there is a difference?
Author
Owner

@Mentis commented on GitHub (Sep 5, 2018):

Actually it works for me in Chrome (took build 1515)! We just need to add more browsers now.

@Mentis commented on GitHub (Sep 5, 2018): Actually it works for me in Chrome (took build 1515)! We just need to add more browsers now.
Author
Owner

@Mentis commented on GitHub (Sep 5, 2018):

I have Pixel XL and Android 9

@Mentis commented on GitHub (Sep 5, 2018): I have Pixel XL and Android 9
Author
Owner

@szale9001 commented on GitHub (Sep 5, 2018):

@kspearrin Yea, it actually worked for me as well (Pixel 2 with Android 9). That said, it stops working after 2 or 3 sites on my device. Restarting chrome seems to fix it though, so that might be a chrome issue (Chrome 69) vs a bitwarden issue

EDIT: Also, not sure how good the Android simulator is, but there is a flag in chrome (Autofill Accessibility) that is enabled by default on most chrome loadouts. Maybe if you explicitly enable it in the simulator, you'll be able to test it successfully?

@szale9001 commented on GitHub (Sep 5, 2018): @kspearrin Yea, it actually worked for me as well (Pixel 2 with Android 9). That said, it stops working after 2 or 3 sites on my device. Restarting chrome seems to fix it though, so that might be a chrome issue (Chrome 69) vs a bitwarden issue EDIT: Also, not sure how good the Android simulator is, but there is a flag in chrome (Autofill Accessibility) that is enabled by default on most chrome loadouts. Maybe if you explicitly enable it in the simulator, you'll be able to test it successfully?
Author
Owner

@kspearrin commented on GitHub (Sep 6, 2018):

@szale9001 Where do you see this setting in Chrome? I can't find it on my simulator. Chrome 68

@kspearrin commented on GitHub (Sep 6, 2018): @szale9001 Where do you see this setting in Chrome? I can't find it on my simulator. Chrome 68
Author
Owner

@szale9001 commented on GitHub (Sep 6, 2018):

Should be about to find it here:

chrome://flags/#enable-android-autofill-accessibility

Just set the flag to enabled and restart the browser.

@szale9001 commented on GitHub (Sep 6, 2018): Should be about to find it here: chrome://flags/#enable-android-autofill-accessibility Just set the flag to enabled and restart the browser.
Author
Owner

@kspearrin commented on GitHub (Sep 6, 2018):

@szale9001 Thanks, that fixed it! I guess default is off for whatever reason.

@kspearrin commented on GitHub (Sep 6, 2018): @szale9001 Thanks, that fixed it! I guess default is off for whatever reason.
Author
Owner

@szale9001 commented on GitHub (Sep 6, 2018):

Well because Google is Google, default means whatever they want (just to make it extra confusing). So default for Android 9, Pixel is probably enabled and default for your sim is probably off. Either way, glad it worked!

@szale9001 commented on GitHub (Sep 6, 2018): Well because Google is Google, default means whatever they want (just to make it extra confusing). So default for Android 9, Pixel is probably enabled and default for your sim is probably off. Either way, glad it worked!
Author
Owner

@kspearrin commented on GitHub (Sep 6, 2018):

I added more support for other browsers in latest build

@kspearrin commented on GitHub (Sep 6, 2018): I added more support for other browsers in latest build
Author
Owner

@fredgolightly commented on GitHub (Sep 6, 2018):

This still isn't native support, is it? It's just enabling the acessability service which can cause lag and batter drain. AFAIK there's still not native web browser autofil api working

@fredgolightly commented on GitHub (Sep 6, 2018): This still isn't native support, is it? It's just enabling the acessability service which can cause lag and batter drain. AFAIK there's still not native web browser autofil api working
Author
Owner

@kspearrin commented on GitHub (Sep 6, 2018):

Not sure what you mean, but it's about as native as you can get with browsers.

@kspearrin commented on GitHub (Sep 6, 2018): Not sure what you mean, but it's about as native as you can get with browsers.
Author
Owner

@szale9001 commented on GitHub (Sep 6, 2018):

@fredgolightly In Android Pie they built in a way to allow the autofill API to access certain parts of the accessibility system on a per-app basis (mostly browsers). So while there might be a performance hit while using this autofill mode in those specific apps, it is nowhere near as bad as enabling the global Accessibility service.

@szale9001 commented on GitHub (Sep 6, 2018): @fredgolightly In Android Pie they built in a way to allow the autofill API to access certain parts of the accessibility system on a per-app basis (mostly browsers). So while there might be a performance hit while using this autofill mode in those specific apps, it is nowhere near as bad as enabling the global Accessibility service.
Author
Owner

@szale9001 commented on GitHub (Sep 17, 2018):

I think we are good with this now. Closing issue.

@szale9001 commented on GitHub (Sep 17, 2018): I think we are good with this now. Closing issue.
Author
Owner

@szszoke commented on GitHub (Oct 29, 2018):

The issue @szale9001 mentioned still happens to me. I'm running a OnePlus 6 on Pie. I enabled the accessibility flag explicitly in the browser. It still stops working after 2-3 sites and I have to restart Chrome to fix it.

@szszoke commented on GitHub (Oct 29, 2018): The issue @szale9001 mentioned still happens to me. I'm running a OnePlus 6 on Pie. I enabled the accessibility flag explicitly in the browser. It still stops working after 2-3 sites and I have to restart Chrome to fix it.
Author
Owner

@szale9001 commented on GitHub (Oct 29, 2018):

Yea, still happens. Unfortunately I think it is a chrome bug. I tried dashlane and 1password to see if they consistently threw autofill prompts and they seemed to have the same problem.

@szale9001 commented on GitHub (Oct 29, 2018): Yea, still happens. Unfortunately I think it is a chrome bug. I tried dashlane and 1password to see if they consistently threw autofill prompts and they seemed to have the same problem.
Author
Owner

@Chevrah commented on GitHub (Nov 29, 2018):

Is this something that is being worked on?

@Chevrah commented on GitHub (Nov 29, 2018): Is this something that is being worked on?
Author
Owner

@kspearrin commented on GitHub (Nov 29, 2018):

No, since it was completed several months ago.

@kspearrin commented on GitHub (Nov 29, 2018): No, since it was completed several months ago.
Author
Owner

@Chevrah commented on GitHub (Nov 29, 2018):

I just updated to Pie on my S9 and Autofill just doesn't work in the browser.

@Chevrah commented on GitHub (Nov 29, 2018): I just updated to Pie on my S9 and Autofill just doesn't work in the browser.
Author
Owner

@kspearrin commented on GitHub (Nov 29, 2018):

Are you using a browser that is compatible with autofill ?

@kspearrin commented on GitHub (Nov 29, 2018): Are you using a browser that is compatible with autofill ?
Author
Owner

@Chevrah commented on GitHub (Nov 29, 2018):

I'm using chrome, and enabled chrome://flags/#enable-android-autofill-accessibility

@Chevrah commented on GitHub (Nov 29, 2018): I'm using chrome, and enabled chrome://flags/#enable-android-autofill-accessibility
Author
Owner

@kspearrin commented on GitHub (Nov 29, 2018):

Did you enable the Bitwarden auto fill service?

@kspearrin commented on GitHub (Nov 29, 2018): Did you enable the Bitwarden auto fill service?
Author
Owner

@Chevrah commented on GitHub (Nov 29, 2018):

Yes. It works in apps.

@Chevrah commented on GitHub (Nov 29, 2018): Yes. It works in apps.
Author
Owner

@ghost commented on GitHub (Jan 5, 2019):

Same issue here, not working in Chrome 71 or Chrome beta. I tried setting the flag, auto fill in apps and Firefox works. I have s9, i'm thinking this might be a Samsung bug?

@ghost commented on GitHub (Jan 5, 2019): Same issue here, not working in Chrome 71 or Chrome beta. I tried setting the flag, auto fill in apps and Firefox works. I have s9, i'm thinking this might be a Samsung bug?
Author
Owner

@ozolli commented on GitHub (Jan 6, 2019):

Tested today the autofill framework on a Huawei Mate 10 Pro, Android 9 and Bitwarden or Dashlane with Chrome Beta or Firefox Beta.
Each of the 4 combinations has the same issue : It works on 1 or 2 sites then I have to restart the browser to make it work again. Looks like an Android 9 bug...

@ozolli commented on GitHub (Jan 6, 2019): Tested today the autofill framework on a Huawei Mate 10 Pro, Android 9 and Bitwarden or Dashlane with Chrome Beta or Firefox Beta. Each of the 4 combinations has the same issue : It works on 1 or 2 sites then I have to restart the browser to make it work again. Looks like an Android 9 bug...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#231