Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofill in chrome (or some chrome based browsers) #551

Closed
AJJLagerweij opened this issue May 11, 2020 · 60 comments
Closed

Autofill in chrome (or some chrome based browsers) #551

AJJLagerweij opened this issue May 11, 2020 · 60 comments

Comments

@AJJLagerweij
Copy link

Describe the bug
My chrome browser does not seem to find any autofill fields whereas firefox (focus and preview) browser does for the same website.

To Reproduce
Steps to reproduce the behaviour:

  1. Open in a url for which an autofill is setup with firefox and chrome
  2. Ony in firefox, I see the autofill option, not in chrome

Expected behaviour
I expected that Autofill would work on (all) mainstream browsers.

** Keepass Database **

  • Created with: KeePassXC 2.5.4
  • Version: .kdbx 4.0
  • Location: Remote file retrieved with DS Cloud (synology)
  • Size: 200kb
  • Contains attachment: No

KeePassDX (please complete the following information):

  • Version: 2.5
  • Build: Free
  • Language: Nederlands

Android (please complete the following information):

  • Device: LG V30
  • Version: Android 9 (security update 1 nov 2019)

Additional context
Add any other context about the problem here.

  • Browser for Autofill: Chrome (Chrome Beta, Ecosia) and Firefox (Focus, Preview)
@J-Jamet
Copy link
Member

J-Jamet commented May 11, 2020

This is a problem in Chrome, you should open an issue with the relevant Chrome projects, I can't do anything from KeePassDX.
Maybe the chrome browser knowingly blocks the autofill, I don't really know.
It's listed in the wiki: https://github.com/Kunzisoft/KeePassDX/wiki/AutoFill#web-browser-app-bug

Edit: A solution was found to integrate the Autofill compatibility mode. #551 (comment)

@AJJLagerweij
Copy link
Author

Thanks for your response I should have looked at the docs more carefully first. I have to admit it's stupid that Google made the api in android but didn't implement it in their browser.

@J-Jamet
Copy link
Member

J-Jamet commented May 11, 2020

Yes, I don't really understand this logic either. If you find the exact answer in your research on Chrome, you can leave a comment, it would be interesting to know the reason! ;)

@AJJLagerweij
Copy link
Author

I found out that, as expected users of other Autofill apps are complaining about the lack and inconsistency of Autofill in chromium based browsers, see this thread at bitwarden.

The Chromium bug reporter has quite a couple of Autofill bugs listed.
I think that this is the one we are interested in: https://bugs.chromium.org/p/chromium/issues/detail?id=849774&q=Autofill%20framework&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

It seems however that some other password managers can get the Autofill to work in chrome even though it is quite buggy sometimes. See for example this Reddit thread, I'm not sure how Bitwarden and 1Password made this work without using the accessibility plugins.

It seems that the Autofill API is not properly working in Chromium-based browsers but that workarounds are possible. As to why it is not implemented correctly in Chromium is unclear, maybe they haven't had the time to fix the problems yet.

@J-Jamet
Copy link
Member

J-Jamet commented May 12, 2020

I had read the issue on bitwarden, what intrigues me is this comment: bitwarden/mobile#489 (comment)

It indicates that previous versions are working, so I did some research on web. I found this image which comes from androidcentral:
autofill_chrome

Which clearly indicates that there was an option before. But in new versions of Chrome, this has been replaced by menus "Passwords", "Payment methods", "Addresses and more" so the connection information for filling in the form is linked only to a Google account. (Not stupid guys, I'll let you make your own conclusions!)

The reddit discussion indicates that Chrome, 78.0.3904.96 and less is working. There may be specific versions of the web browser to test and maybe downgraded.

@J-Jamet J-Jamet reopened this May 12, 2020
@AJJLagerweij
Copy link
Author

I agree with your findings, this is definitely a google thingy, sadly autofill also part of the modern non-google chromium builds I checked through F-Droid. Should I try to get in touch with Bitwarden to see how they circumvent the issue?

@Stephan-P
Copy link
Contributor

Please note that Bitwarden is able to provide autofill using the (old fashioned0 Accesibility Service only. The (newer) Android Autofill service is not yet functional with e.g. Chrome, Vivaldi and other browsers. They are in this mess as well.

To add to this, I just discovered to my great joy that KeePassDX does provide autofill in the DuckDuckGo browser using the (new) Android Autofill Service.

System details:
Nokia 3.1
Android 9
Vivaldi - Snapshot 3.1.1905.3 (my main browser)
DuckDuckGo 5.53.1 (fallback browser)
Bitwarden 2.3.1 Beta channel
Bitwarden Autofill Service - disabled (it doesn't work. check with each release)
Bitwarden Accessibility Service - enabled (functional with Vivaldi-browser)
KeePassDX 2.5
KeePassDX Autofill Service - enabled (functional with DDG-browser)
KeePassDX Accesibility Service - disabled
KeePassDX Magikeyboard - disabled (don't like it)

@AJJLagerweij
Copy link
Author

Yeah I also found Firefox, DuckDuck Browser to work work and Dolfin did sometimes work.

@J-Jamet
Copy link
Member

J-Jamet commented May 17, 2020

I am not for the use of the accessibility service, because this service is not made for that. He is present for people with disabilities. If we use this service for something else, it's like we have a ramp for the disabled, and we use it for biking. Sure, it works but people who need this service for something else are blocked.
Chrome has knowingly blocked autofill so it's up to them to re-enable it for their browser, it's not up to us to find alternative solutions and workarounds.
It is a good thing to list the compatible browsers but the version number of each application must be present and we must indicate if it depends directly on the WebView of the device.

@szaimen
Copy link

szaimen commented May 31, 2020

I am all in for using accessibility settings to be able to autofill in chromium based browsers because you can use that with more than one app: it is not blocked by one app unlike the autofill service.

@chilliger
Copy link

chilliger commented Jun 2, 2020

@csagan5 what do you think? Is it possible to enable autofill in bromite until this is fixed upstream?

@csagan5
Copy link

csagan5 commented Jun 2, 2020

@csagan5 what do you think? Is it possible to enable autofill in Bromite until this is fixed upstream?

After reading this and related issues I understand that only under certain conditions a Chromium derivative will use the Android autofill framework and otherwise it uses Sync. Related Bromite issues: bromite/bromite#230 bromite/bromite#348

The upstream issue to track seems to be https://bugs.chromium.org/p/chromium/issues/detail?id=1015381

I have also verified that Bitwarden works with Chrome through the autofill framework even before Sync is enabled, but I could not reproduce this working behavior with any Chromium (also when it uses org.chromium.chrome as package name); this matches what most of the pople in
bitwarden/mobile#489 have reported. Other apps use a keyboard/or a plugin to workaround these issues, see also https://github.com/PhilippC/keepass2android/blob/master/docs/AccServiceAutoFill.md

I do not know precisely when upstream broke the "Android autofill framework" support but it matches what I have seen in submitted Bromite issue reports over last year or so; we have to wait for upstream to fix it, if they will (last comment from developers was on December 2019, it is outside any PO list and thus it's unlikely it will be fixed soon).

I am however interested in why it works for Bitwarden for Chrome without Sync enabled, if any progress can be done on this research then we could leverage it.

@J-Jamet I took the liberty to mention the upstream bug in https://github.com/Kunzisoft/KeePassDX/wiki/AutoFill (maybe having more users vote on this bug is a good thing)

@Stephan-P
Copy link
Contributor

Bitwarden too is having problems with the Autofill service and really only functions through the Accessibility service.
bitwarden/mobile#952

@csagan5
Copy link

csagan5 commented Jun 3, 2020

@Stephan-P I had just tested it without accessibility, it works for Chrome.

@J-Jamet
Copy link
Member

J-Jamet commented Jun 5, 2020

@csagan5 Please indicate the version of Android, the version of Chrome and bitwarden. If Bitwarden works without accessibility, there must be a tip.
And no problem to indicate the link in the wiki.

@csagan5
Copy link

csagan5 commented Jun 5, 2020

Please indicate the version of Android, the version of Chrome and bitwarden. If Bitwarden works without accessibility, there must be a tip.

Android 9, Chrome 80.0.3987.149 and 83.0.4103.96, Bitwarden 2.4.2 and the previous version (I guess 2.4.1 or 2.4.0). No account signed-in in Chrome.

@J-Jamet J-Jamet added bug and removed invalid labels Jun 5, 2020
@J-Jamet
Copy link
Member

J-Jamet commented Jun 5, 2020

@csagan5
Indeed, I just tested with the configuration you just gave and it works for Bitwarden but not with KeePassDX (I have no log arriving), as if it did not even fit into the service methods. I do not understand why, I will do more tests.

@J-Jamet
Copy link
Member

J-Jamet commented Jun 5, 2020

It seems to be related to the internal compatibility system of the Chrome application for this version, I will add configurations for each browser, as did Bitwarden.
https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode
I will also improve the parser, I have good results with this config.

@J-Jamet J-Jamet added this to To do in KeePassDX_2.7 via automation Jun 5, 2020
@J-Jamet J-Jamet moved this from To do to In progress in KeePassDX_2.7 Jun 5, 2020
@KaktusXY
Copy link

KaktusXY commented Aug 27, 2020

Using the latest version 2.7, latest Chrome version, Android 10 OOS

Chrome does not seem to be autofilling for me it just reports "com.android.chrome" to the app and asks you to search yourself. Just wanted to report...

Yes I can confirm this behavior with Chrome 84.0.4147.111 and keepassdx 2.8.1 with Android 10. On Firefox the url is passed to keepass

Problem with the Autofill-Service

I used Keepass2Android (https://github.com/PhilippC/keepass2android) before and there Chrome (Brave) reported the Website URL, but with KeepassDX it only reports "com.brave.browser" and not the URL of the Website. But in the DuckDuckGo Browser (v.5.61.2) it works correctly.

Brave version : 1.12.113

@J-Jamet
Copy link
Member

J-Jamet commented Aug 27, 2020

I used Keepass2Android (https://github.com/PhilippC/keepass2android) before and there Chrome (Brave) reported the Website URL, but with KeepassDX it only reports "com.brave.browser" and not the URL of the Website.

@KaktusXY Please confirm :

  • It was autofill and not the accessibility service
  • Your browser version

@KaktusXY
Copy link

KaktusXY commented Aug 27, 2020

@J-Jamet
Whats the difference between autofill and the accessibility service

@J-Jamet
Copy link
Member

J-Jamet commented Aug 27, 2020

I repeat:

Accessibility service : https://developer.android.com/reference/android/accessibilityservice/AccessibilityService
Sometimes used by other managers as a hack but should only be used to assist users with disabilities. Will not be used in KeePassDX. #551 (comment)

Autofill service : https://developer.android.com/reference/android/service/autofill/AutofillService
The service for filling out forms, must be integrated into the browser. If the browser do not support it natively, the compatibility mode is used and the webdomain cannot be used. #551 (comment)

Chrome removed its code for autofill. The derivatives therefore no longer have it either. #551 (comment)

If your browser is already in the compatibility list (https://github.com/Kunzisoft/KeePassDX/blob/master/app/src/main/res/xml/dataset_service.xml)
but the behavior does not suit you, ask the browser developers to add autofill. Otherwise change browser.

@Kunzisoft Kunzisoft deleted a comment from KaktusXY Aug 28, 2020
@cloudy-dev
Copy link
Contributor

I used Keepass2Android (https://github.com/PhilippC/keepass2android) before and there Chrome (Brave) reported the Website URL, but with KeepassDX it only reports "com.brave.browser" and not the URL of the Website.

@KaktusXY Please confirm :

  • It was autofill and not the accessibility service
  • Your browser version

Since @KaktusXY didn't answer, or at least his comment was deleted, I'm gonna answer this one.
Keepass2Androids autofill in Chrome works without a problem for me.

  • the accessibility service plugin was not installed, and no accessibility service active
  • Google Chrome Version: 85.0.4138.127
  • Keepass2Android Version: 1.08b

Changelog for K2A Version 1.07b: "Add AutoFill support for several more browsers" .Maybe this added Chrome support too. I could test this if you want.

Thank you for developing this awesome app btw. ❤️

@J-Jamet
Copy link
Member

J-Jamet commented Oct 1, 2020

@cloudy-dev OK, Thank you for the feedback.
When you says "Keepass2Androids autofill in Chrome works without a problem for me.", Does that mean that the WebDomain is correctly retrieved and that autosearch works on this version "85.0.4138.127" of Chrome?

@J-Jamet
Copy link
Member

J-Jamet commented Oct 1, 2020

Indeed, I just tested and K2A get the WebDomain, I will try to find out how it does! thank you for the info

@J-Jamet J-Jamet removed the wontfix label Oct 1, 2020
@J-Jamet J-Jamet added this to To do in KeePassDX_2.9 via automation Oct 1, 2020
@J-Jamet J-Jamet moved this from To do to In progress in KeePassDX_2.9 Oct 1, 2020
@J-Jamet
Copy link
Member

J-Jamet commented Oct 1, 2020

OK, honestly I don't know why it works with K2A and not with KPDX.

The webDomain is retrieved the same way: https://github.com/PhilippC/keepass2android/blob/555109c2439f0479a84950cca4fc6497623cecf5/src/keepass2android/services/AutofillBase/StructureParser.cs#L259

But on KeePassDX, the value I get is allways null with Chrome.

If anyone knows why, please enlighten me.

@cloudy-dev
Copy link
Contributor

I have no idea why it doesn't work in this app. Autofill in Chrome also works with the Bitwarden Android app, so maybe there are some hints in their codebase.

https://www.github.com/bitwarden/mobile/tree/master/src%2FAndroid%2FAutofill

@J-Jamet
Copy link
Member

J-Jamet commented Oct 5, 2020

OK, I found the reason. In KeePassDX the code is optimized to parse only the wanted content of a form and is stopped when the desired values ​​are retrieved. But on some browsers in compatibility mode (the new Chrome app), the recovery of the WebDomain is done at the end of the content, so here was not parsed.
I will therefore be able to correct the problem for the next version! :)

Note: This will make it easier to complete the forms by activating the auto search, but it will still not be possible to save new elements with the applications in compatibility mode.

@J-Jamet J-Jamet moved this from In progress to Done in KeePassDX_2.9 Oct 5, 2020
@auanasgheps
Copy link

Hurray! This was one of the last points where KeePass2Android was still ahead.

@cloudy-dev
Copy link
Contributor

This is so awesome, thanks so much for your work! <3

@hshalexgwamf7d3vlblvbqd971ii6o

Why close this issue? The issue was not fixed at all. Autofill is still not triggering on chromium-based browsers.

@J-Jamet
Copy link
Member

J-Jamet commented Nov 2, 2020

I have tested many times and I no longer have problems on all my devices. Are you sure you are on version 2.9?

@J-Jamet
Copy link
Member

J-Jamet commented Nov 3, 2020

I added the known information to the Wiki https://github.com/Kunzisoft/KeePassDX/wiki/AutoFill#web-browser-recognition

@csagan5
Copy link

csagan5 commented Oct 24, 2021

Bromite will now have native Android autofill support starting from version 94.0.4606.109; I edited the wiki page to mention this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests