mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.2k stars 2.92k forks source link

Opening a link in external app leaves a "loading" about:blank page behind #17571

Closed vsanjay85 closed 6 months ago

vsanjay85 commented 10 months ago

Steps to reproduce

  1. Open a website that might potentially redirect you to a locally installed app. An example is a deals website or a social media website that might redirect you to Youtube, Instagram, etc
  2. Click on a link that would redirect you to a locally installed app, such as an Amazon or Walmart URL or any other application you currently have installed.

Expected behavior

  1. Redirect user to the external app and load the copied URL

Actual behavior

  1. Redirect user to the external app and load the copied URL
  2. Firefox leaves an "about:blank" page behind that stays stuck in 'loading' state

Device & build information

I do NOT see this in Safari. I DO see a similar behavior in Chrome

It appears that the browser is opening the link in a browser tab first, and then checking if a locally installed app exists. If this check could happen without opening the link in another tab, that would likely fix it.

Attachments: image image

┆Issue is synchronized with this Jira Task

lmarceau commented 10 months ago

I believe this relates to https://github.com/mozilla-mobile/firefox-ios/issues/15718

vsanjay85 commented 10 months ago

I believe this relates to #15718

They do seem to be related, although #15718 assumes that this behavior is only for Youtube, whereas this is the default behavior for all apps.

brendanjones commented 9 months ago

I'm also seeing this bug.

PraveenJP commented 8 months ago

Me as well

Cpt-KeksMonster commented 7 months ago

Since the recent versions of Firefox for iPadOS many links just open to about:blank. Especially PayPal links on checkout, e.g. trying to start (to pay for) a Tidal subscription. Also "download image" at imgflip.com shows this behavior. Gotten worse the last weeks. 😢

brendanjones commented 7 months ago

Not just iPad, also on iOS. The link goes in the URL bar but doesn’t load. Selecting ‘reload’ does not load the page, but selecting the link and then tapping ‘Go’ does load the page.

dicarobinho commented 7 months ago

@lmarceau

Investigated this issue for a while, and...

Based on the current code version, that "about:blank" page was/is intended and also someone left an important comment related to this behaviour.

" // If the page uses window.open() or [target="_blank"], open the page in a new tab. // IMPORTANT!!: WebKit will perform the URLRequest automatically!! Attempting to do // the request here manually leads to incorrect results!! "

BUT

In order to open a link for example via Youtube (native app), currently Firefox open Youtube app but also a empty page (blank page). To avoid this behaviour, we can check first if the app (e.g. Youtube) is installed, using "UIApplication.shared.canOpenURL" method.

If "Yes" we can open the native app using "UIApplication.shared.open" else continue to the current implementation. (which is working fine if no native app is installed)

A short mention here: every native app (e.g. Youtube, Instagram) that we want to be covered by this approach should be added to the "LSApplicationQueriesSchemes" list.

"LSApplicationQueriesSchemes" list already have apps like: googlegmail and whatsapp.

data-sync-user commented 7 months ago

➤ Norberto Andres Furlan commented:

Alina Moldovan Andrei Bodea I changed the priority of this issue. We have a lot of reports from users about this happening more frequently on 124 than on previous versions and I want to make sure we are fixing it for the next weekly release.

data-sync-user commented 7 months ago

➤ Andrei Bodea commented:

Hi, thank you Norberto Andres Furlan on what version is this issue fixed? I understand the Fix version: weekly release there but might be worth mentioning in a comment what version was this issue fixed first.

data-sync-user commented 7 months ago

➤ Alina Moldovan commented:

Validated this using v9000 (40010) and iPhone 14+ (16.0.3). Not able to reproduce the original issue ("about:blank" page) but I found that the current behavior is a bit defect than the old one

Steps:

  1. Search on google for Instagram pages; Make sure Instagram app is already installed on the device
  2. Tap on a link => you are redirected to Instagram app
  3. Navigate back to FF and check the tab

Expected: Google search results are visible

Actual: The Instagram page you already loaded in Instagram app is loaded on Firefox also.

Adding two videos:

OLD Behavior

!Skype_Video10.mp4|width=41.66666666666667%!

NEW Behavior

!Skype_Video9.mp4|width=886,height=1920!

Norberto Andres Furlan Alexandru Farcasanu

data-sync-user commented 7 months ago

➤ Alexandru Farcasanu commented:

I tested on the main branch that contain this fix too.

As Alina Moldovan , I can reproduce this issue but also I removed from the code, the implementation for this ticket and the problem still be there. That means, something else, changed that behaviour and is not related to code added for this ticket.

I will get the answer as soon as possible and I will come here with an update.

data-sync-user commented 7 months ago

➤ Norberto Andres Furlan commented:

Nishant Bhasin maybe the fixes we pushed on v124 also affected this behavior.

data-sync-user commented 7 months ago

➤ Alexandru Farcasanu commented:

Norberto Andres Furlan

After more investigations, this behaviour is related to this ticket: https://mozilla-hub.atlassian.net/browse/FXIOS-7586 ( https://mozilla-hub.atlassian.net/browse/FXIOS-7586|smart-link )

Sorin Paraipan is taking a look on it.

data-sync-user commented 6 months ago

➤ Andrei Bodea commented:

Verified as fixed on v124.2 (38968) with iPhone 15 Pro (17.3). We tried with the following apps: Gmail, Amazon, HBO MAX, Reddit, Snapchat, Skype, OLX, Books App, Weather App, notepad, and many other news sites.

Please note that we were not able to reproduce this issue anymore, but we will keep looking into the deep links / external links issues.

Cpt-KeksMonster commented 6 months ago

For me: fixed for virtually all websites. Exception found: PayPal payment after a Steam purchase. Still opens blank tabs, 3-5 tries necessary before the PP website opens and payment can be completed.