mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
6.47k stars 1.27k forks source link

[Bug] Open links in apps does not open links in apps #10838

Closed plwt closed 4 years ago

plwt commented 4 years ago

Steps to reproduce

With "Open links in apps" toggled to on

Expected behavior

YouTube App opens

Actual behavior

YouTube page opens

Device information

┆Issue is synchronized with this Jira Task

ImranR98 commented 4 years ago

This is also a problem for my banking app (CIBC in Canada). When someone sends me money, the link in my email takes me to a webpage with an 'open in app' button. Clicking this button should open the bank app, but doesn't. Works fine in the regular Firefox app.

ghost commented 4 years ago

Duplicate of #9923 but the issue has been marked as closed and links still don't redirect to their respective apps for me as well on Nightly 200519 18:01 (Build #2015741267). #10436 is also still reproducible for me.

Edit: Still doesn't work on Nightly 200527 06:01and the issue #9923 has been closed and marked as fixed.

agreenbhm commented 4 years ago

For me, this is also happening with the official Wikipedia app and the Reddit app "Relay for Reddit". If I choose the option "open in app" when already on the page it will open with the correct app at that point. Also, Amazon does not open in the app, but also does not show "open in app" in the menu, so I can't manually switch it either.

ghost commented 4 years ago

@vesta0 @ekager I also reported this #10436 bug it was closed and marked as duplicate in favour of #9923. Is the bug that I reported defferent than this or am I not understand this clearly?

kbrosnan commented 4 years ago

In my investigation of #11353 this looks to be an issue with Google search links. I suspect that whatever they do for redirection breaks the open in app feature.

Steps to reproduce

Expected behavior

Content opens in Youtube app

Actual behavior

Content opens in Firefox tab

Workaround

rocketsroger commented 4 years ago

This is also a problem for my banking app (CIBC in Canada). When someone sends me money, the link in my email takes me to a webpage with an 'open in app' button. Clicking this button should open the bank app, but doesn't. Works fine in the regular Firefox app.

@ImranR98 your issue seems like its different from this. We recently had a new fix from GeckoView and it was meant to fix issues related to yours. Can you please check with the latest nightly to see if your issue has been resolved? If not we might need to open an issue to track it. Thanks

rocketsroger commented 4 years ago

Confirmed that the YouTube issue from google search is due to how google redirect its search before loading the YouTube URL. Currently app links does not automatically open links in an external app if the link was loaded due to a redirect. This is to prevent sites from opening an external app without user's gesture. The fix is to open links in external apps even with redirect. This is a requirement discussion.

rocketsroger commented 4 years ago

@vesta0 Should we assume that the user wants any links to be opened in external apps even if the link is open due to a redirect?

vesta0 commented 4 years ago

@rocketsroger yes that should be the expected behaviour for when "open in app" it toggled on.

rocketsroger commented 4 years ago

@rocketsroger yes that should be the expected behaviour for when "open in app" it toggled on.

Understood. I'll make the changes. Thanks,

ghost commented 4 years ago

I can still reproduce the issue #10436 on the latest Nightly 200627 06:01 on Motorola One Power, Android 10.

QA if you're testing this then please test the mentioned issue as well since this bug and the mentioned one are same issues.

rocketsroger commented 4 years ago

I can still reproduce the issue #10436 on the latest Nightly 200627 06:01 on Motorola One Power, Android 10.

QA if you're testing this then please test the mentioned issue as well since this bug and the mentioned one are same issues.

The fix was merged last night. Once A-C version is updated next week this issue should be fixed. Thanks,

ghost commented 4 years ago

@rocketsroger this works perfectly on all websites I have tested, on Nightly 200628 06:01 but I have found some websites where it doesn't redirect to the Play Store

  1. https://www.androidpolice.com/2020/06/27/the-best-free-and-open-source-alternatives-to-gmail-on-android/

On the above site there're 2 links where they redirect to FairMail and K-9 Mail. Click on them and see it doesn't redirect to the Play Store app but instead opens the Play Store website. On Chrome browser it redirects to the Play Store on clicking those links.

  1. https://www.apkmirror.com/apk/mozilla/firefox-preview-nightly-for-developers/firefox-preview-nightly-for-developers-nightly-200505-0600-release/

Here click on the Play Store icon and see it doesn't redirect to the Play Store and instead redirects to the Play Store website. On Chrome browser it opens the Play Store app.

rocketsroger commented 4 years ago

Fenix nightly with A-C 48.0.20200628130058 this should be fixed

rocketsroger commented 4 years ago

@rocketsroger this works perfectly on all websites I have tested, on Nightly 200628 06:01 but I have found some websites where it doesn't redirect to the Play Store

Do you mind opening a new issue? I'll have to investigate, since play store redirect is different than this issue. Thanks!

ghost commented 4 years ago

@rocketsroger this works perfectly on all websites I have tested, on Nightly 200628 06:01 but I have found some websites where it doesn't redirect to the Play Store

Do you mind opening a new issue? I'll have to investigate, since play store redirect is different than this issue. Thanks!

Yes, I'll create a new issue for it. And let you know in a moment when I have done so.

Thanks! :)

ghost commented 4 years ago

@rocketsroger Here's the issue for Play Store links #12092.

rocketsroger commented 4 years ago

@rocketsroger Here's the issue for Play Store links #12092.

Thanks!

sv-ohorvath commented 4 years ago

I have verified the STR from the description and the comment below, both issues are fixed on Beta 79.0.0-beta1. Closing.

I can still reproduce the issue #10436 on the latest Nightly 200627 06:01 on Motorola One Power, Android 10. QA if you're testing this then please test the mentioned issue as well since this bug and the mentioned one are same issues.

The fix was merged last night. Once A-C version is updated next week this issue should be fixed. Thanks,

rocketsroger commented 4 years ago

I have made changes to prevent some bad redirect cases. Google search result directly to external apps (Facebook, Twitter, Youtube etc) will stop working. The user have to use the menu to open the page in app after it is loaded. https://github.com/mozilla-mobile/android-components/issues/7637.

ncodee commented 3 years ago

Having the same issue with Firefox v89 on Android.

rocketsroger commented 3 years ago

Having the same issue with Firefox v89 on Android.

@ncodee there's a lot of different possibilities with this issue. Can you please open an issue with how to reproduce it? Please let me know once you opened it and I'll investigate. Thanks,

BrajBliss commented 3 years ago

I have it turned off, but still it opens all links in apps. I don't want that.

OlegAlekos commented 3 years ago

App-links are not working in any version i have tried!!! I see a lot of "closed" bugs, but unfortunatly it is the only Mobile android Browser that is also mainstream that doesn't Respect the App-Link( with digital asset on Server) That OPENS THE APP!!!!! Please fix. It is dragging down the android experience.

Thank you!

rocketsroger commented 3 years ago

I have it turned off, but still it opens all links in apps. I don't want that.

Please let me know how to reproduce this. Currently our implementation is that if the browser cannot show the intent directly it finds an app to open it. However, if you let me know the exact use case I can do some more investigation. Thanks,

rocketsroger commented 3 years ago

App-links are not working in any version i have tried!!! I see a lot of "closed" bugs, but unfortunatly it is the only Mobile android Browser that is also mainstream that doesn't Respect the App-Link( with digital asset on Server) That OPENS THE APP!!!!! Please fix. It is dragging down the android experience.

Thank you!

@OlegAlekos I want to help and improve your experience with our browser. Please open an issue and let me know. I will investigate and try to make your experience better. Thanks for letting us know.

hollowstrawberry commented 3 years ago

This still happens with Reddit links on google searches for the app "RIF for Reddit". Once in the site it prompts you to open in app, and that button does work correctly.

Edit: I can only reproduce this with the "Google Search Fix" addon installed, I suppose it's fine then

pic2022 commented 2 years ago

This STILL doesn't work. What are you guys doing?

rocketsroger commented 2 years ago

This STILL doesn't work. What are you guys doing?

@pic2022 please let me know how to reproduce this problem. When you say it doesn't work, what site were you on and what app did you expect it to open? Thanks

nebiont commented 2 years ago

@pic2022 please let me know how to reproduce this problem. When you say it doesn't work, what site were you on and what app did you expect it to open? Thanks

For me it happens when clicking a URL in an external app. For example:

Here is another example that just happened to me:

rocketsroger commented 2 years ago

@pic2022 please let me know how to reproduce this problem. When you say it doesn't work, what site were you on and what app did you expect it to open? Thanks

For me it happens when clicking a URL in an external app. For example:

* Search for something using the google search app

* Click on one of the returned URLs

* URL opens in Firefox

* Need to open menu and click 'Open in App' in order for it to open in the app.

* If I do the same search from the URL bar in Firefox, and then click one of the returned URLs it will properly open the app.

Here is another example that just happened to me:

* Had an amazon URL sent to me via Facebook Messenger

* Clicked on the URL in Facebook Messenger

* Page opened in Firefox

* Had to open the menu and click 'Open in App' in order for it to open in the Amazon app.

I see. Looks like your issue is with opening a URL in Firefox that can already be opened with the app. Currently when Firefox Android first load a URL we don't redirect automatically to the app. The thought was that since the user is loading the URL, opening the app is probably not what the user want. I can look into this and see if we should auto open 3rd party app if the URL is coming from another app. thanks

pic2022 commented 2 years ago

@pic2022 please let me know how to reproduce this problem. When you say it doesn't work, what site were you on and what app did you expect it to open? Thanks

For me it happens when clicking a URL in an external app. For example:

* Search for something using the google search app

* Click on one of the returned URLs

* URL opens in Firefox

* Need to open menu and click 'Open in App' in order for it to open in the app.

* If I do the same search from the URL bar in Firefox, and then click one of the returned URLs it will properly open the app.

Here is another example that just happened to me:

* Had an amazon URL sent to me via Facebook Messenger

* Clicked on the URL in Facebook Messenger

* Page opened in Firefox

* Had to open the menu and click 'Open in App' in order for it to open in the Amazon app.

I see. Looks like your issue is with opening a URL in Firefox that can already be opened with the app. Currently when Firefox Android first load a URL we don't redirect automatically to the app. The thought was that since the user is loading the URL, opening the app is probably not what the user want. I can look into this and see if we should auto open 3rd party app if the URL is coming from another app. thanks

Yeah sorry it took me a while to get to this. Exactly what @nebiont is experiencing. Another example, in the Google (app) search bar on Android, not in Firefox.

I search "pokemon - reddit"

I see the results.

I click on one of them, it opens up Firefox when I have a reddit app installed. Why not just open directly to that app?

If you can make this an option, that'd be amazing.

rocketsroger commented 2 years ago

If you can make this an option, that'd be amazing.

Sounds good, I've created an issue to track this. Once I have a chance I'll look for a solution. Thanks