Focus-android: Open with a Chromium browser is broken, open with not listing all installed browsers

Created on 29 Jan 2018  路  24Comments  路  Source: mozilla-mobile/focus-android

I'd like to be able to open externally in chromium, chromium swe, chrome, or another webview based browser.

I understand that maybe it's set to only allow opening externally in Mozilla based browsers when they're installed for market share reasons or whatever, but to be honest Firefox for Android right now is really slow and buggy.

I'll do the pull request myself or maintain my own fork if someone tells me where to look to change this.

P3 help wanted

Most helpful comment

Thank you @tasomaniac!

I filed this as an issue in our Android Components repository:
https://github.com/mozilla-mobile/android-components/issues/4369

As part of this issue we should migrate Focus to use the component instead of its own implementation.

All 24 comments

Focus currently supports this: Settings -> Open with...

I think you meant to file this against Firefox for Android so I filed this for them: https://bugzilla.mozilla.org/show_bug.cgi?id=1434097

Steps to reproduce:

  1. Install Focus, Chromium/Chromium CAF, and any other Firefox variant or chrome
  2. Set Focus as your default browser
  3. Open a link in Focus and click Open with

Result: Chromium browsers aren't listed
Expected Result: All browsers on the system would be listed

In theory it seems like this should already handle that case, although it only works with a hard-coded list of known browsers. At least Chrome should work though, so something is probably broken here?

On a side note I'd like to add that hard-coding and maintaining a list of known browsers might not actually be necessary - https://github.com/tasomaniac/OpenLinkWith manages to offer the full list of apps supporting a particular link regardless of the current default app settings.

Thanks for the bug report @codebam and suggestion @buttercookie42 - we will triage this soon and get it fixed up.

Thanks @pocmo for the possible solution here: https://github.com/mozilla-mobile/focus-android/issues/2074#issuecomment-366984673

If a contributor can do some investigation and see if it works, that would be great. Please ping @sdaswani if you need more details.

what is the status of it? I'd like to take that but I can't reproduce the issue on my phone. I've tried with a plethora of browsers and they all get listed. Is there any specific that I can try with?

Phone: Huawei p10 lite
Android: 7.0
Focus: 5.0

@codebam any advice on how to repro? Maybe @npark-mozilla has reproduced this?

@Sdaswani I put fairly clear steps in the 3rd comment from the top. Is there something else you need?

edit: my bad, I'm going to make sure this issue still exists. I had the issue with chromium-caf

Yeah okay, I just reproduced it. Using chromium-caf and chromium.

I'd assume other browsers on F-Droid and the like are unsupported as well.

Expected behavior would be that all browsers would be supported, not just the ones that are whitelisted

To reproduce

  1. install one of chromium-caf or chromium
  2. set default browser to firefox focus
  3. open a link
  4. click the action menu and then open in

Result: Only supported browsers are listed
Expected: All apps registered as system web browsers would be listed

@codebam, I went through all the steps with chromium-caf and everything works. The browser is listed and opens any link.
Also, other browsers that I downloaded and are not in the hardcoded list are visible - Kiwi, Yu...

edit: Brave is actually on the list

I went through all the steps with chromium-caf and everything works. The browser is listed and opens any link.

This depends on the Android version. On some versions the system query we use returns all browser and on some it does not (that's why we check against our hard-coded list).

@pocmo, is it a known list of Android versions that doesn't list all the browsers?
@codebam, can you write your configuration so I can try it on a simulator?

@kai-chi I'm currently on Android P Preview on Pixel XL, but I had this issue back in January on 8.1 as well

It should be Android 6+. This blog posting describes the issue we have been seeing:
https://medium.com/google-developer-experts/intent-resolving-in-android-m-c17d39d27048

So from my understanding all Android versions from 6.0 have issues querying the list of browsers using the method that's in Focus? @pocmo

Can the new method be used instead as explained in that article?

apparently not all because I don't have this problem with 7.0.

I couldn't reproduce the issue on my phone, nor the emulator so if anyone else with a different device is keen on taking it then feel free. I could take it once I'll have another device to test

@kai-chi AFAIK you need to have set a default browser in order to observe that behaviour. Is that true in your case?

@buttercookie42 yes, Focus is set as the default browser and I still get listed the other browsers
here are my screens: https://imgur.com/a/JHRVhnf

Could this be expanded to _all_ native apps to handle the URL? That would fall inline w/ @tasomaniac's _(Would you be interested in helping out?)_ OpenLinkWith's handling (https://github.com/mozilla-mobile/focus-android/issues/2074#issuecomment-361511952 & https://github.com/mozilla-mobile/focus-android/issues/2074#issuecomment-366984673) of such, while not leaking ifF, e.g., OpenWith were to be integrated completely.

@TPS thanks for mentioning me here. @pocmo I believe the behavior described in my blog post has been changed after some API level. At least at API level 27+, Android now returns all apps if you use MATCH_ALL flag. That's what I observed at least while working on Open Link With.

Thank you @tasomaniac!

I filed this as an issue in our Android Components repository:
https://github.com/mozilla-mobile/android-components/issues/4369

As part of this issue we should migrate Focus to use the component instead of its own implementation.

Sounds good

The recent versions (IDK whether beta or actual release) I've downloaded seem to do this quite well (with notable exception of Amazon product links not yet opening via Amazon Shopping app). Does anyone else see anything different anymore for > v. 8.0.22?

Was this page helpful?
0 / 5 - 0 ratings