Closed Bug 1416576 Opened 2 years ago Closed 2 years ago

Page shortcut do not open the page when selected if Firefox is alive in background

Categories

(Firefox for Android :: General, defect)

58 Branch
All
Android
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 59
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected
firefox58 --- verified
firefox59 --- fixed

People

(Reporter: jon.stefani, Assigned: jchen)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Android 7.0; Mobile; rv:58.0) Gecko/58.0 Firefox/58.0
Build ID: 20171112100406

Steps to reproduce:

On the latest Firefox nightly for Android (58.0a1), page shortcuts don't open.
Steps:
1) add a shortcut to the homescreen for a website (I made one for hacker news).
2) clear the current instance of Firefox
3) select the shortcut you made previous


Actual results:

The browser window opens to whatever was the last page open. It doesn't actually open the webpage that is associated with the shortcut.


Expected results:

When selecting the shortcut, it should open Firefox to the webpage that the shortcut is for.
(In reply to jon.stefani from comment #0)
> 2) clear the current instance of Firefox

Do you mean "clear" as in just put Firefox into the background, or actually killing/swiping/force stopping it?

After doing the latter, things are working fine for me. I can reproduce this only if Firefox is still alive while in background (and "Don't keep activities" is *not* enabled), which means that we're having some problems with our onNewIntent handling.

When clicking on a homescreen shortcut, I'm seeing the following error message in the browser console:
11-12 23:28:43.431  1437  1453 E GeckoConsole: [JavaScript Error: "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsIBrowserDOMWindow.openURI]" {file: "chrome://browser/content/browser.js" line: 1933}]

Based on the history for https://hg.mozilla.org/mozilla-central/annotate/2535bad09d720e71a982f3f70dd6925f66ab8ec7/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java#l1794, I'm guessing that bug 1412872 broke this.
Blocks: 1412872
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(nchen)
Keywords: regression
OS: Unspecified → Android
Hardware: Unspecified → All
Summary: Page shortcut do not open the page when selected → Page shortcut do not open the page when selected if Firefox is alive in background
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: needinfo?(nchen)
Correctly handle the Tab:OpenUri event introduced in bug 1412872. r=me
for trivial patch.
Attachment #8927999 - Flags: review+
Duplicate of this bug: 1417029
https://hg.mozilla.org/mozilla-central/rev/44b0797a5899
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Comment on attachment 8927999 [details] [diff] [review]
Correctly handle Tab:OpenUri (v1)

Uplift request for 58

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1412872
[User impact if declined]: Cannot launch home screen shortcut in some scenarios
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No
[Why is the change risky/not risky?]: Small regression fix
[String changes made/needed]: None
Attachment #8927999 - Flags: approval-mozilla-beta?
Comment on attachment 8927999 [details] [diff] [review]
Correctly handle Tab:OpenUri (v1)

Fix a regression. Beta58+. Should be in 58.0b5.

Hi Ioana,
Can you help verify if this issue was fixed on the latest Nightly build? Thanks!
Flags: needinfo?(ioana.chiorean)
Attachment #8927999 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
I have tried on different devices together with the team but we were not able to reproduce the bad behavior on 58 beta 3. At this point it works for us both on latest Nightly and on beta. 

Pixel XL - Android 8.0
LG D722 - Android 442
Nexus 5 - Android 6.0.1
Samsung Galaxy Tab S3 - Android 7.0

Jon, Jan are you still able to see this reproducing?
Flags: needinfo?(jon.stefani)
Flags: needinfo?(jh+bugzilla)
Flags: needinfo?(ioana.chiorean)
(In reply to Ioana Chiorean from comment #8)
> I have tried on different devices together with the team but we were not
> able to reproduce the bad behavior on 58 beta 3. At this point it works for
> us both on latest Nightly and on beta. 
> 
> Pixel XL - Android 8.0
> LG D722 - Android 442
> Nexus 5 - Android 6.0.1
> Samsung Galaxy Tab S3 - Android 7.0
> 
> Jon, Jan are you still able to see this reproducing?

As of this morning, I am still seeing it on my Galaxy S8+. It is with Firefox Nightly v59.0a1 (I believe that is the version number. You get it from settings->Mozilla Nightly->About Nightly, correct?). This is on kernel version 4.4, with Android 7.0. I apologize if my reporting is not super great. I have never filed bugs with Mozilla before.
Flags: needinfo?(jon.stefani)
With 59.0a1 (2017-11-14), the problem is here.
With 59.0a1 (2017-11-15), the problem is solved.

Perfect !
Yup, tested with http://ftp.mozilla.org/pub/mobile/candidates/58.0b3-candidates/build4/android-api-16/multi/fennec-58.0b3.multi.android-arm.apk and I can reproduce:
1. Go to some page and create a shortcut.
2. Go back to Firefox, close that tab and open some other page.
3. Background Firefox, but *don't* kill it (and "Don't keep activities" must not be enabled, either).
4. Click on the shortcut.
5. Firefox comes back into the foreground, but doesn't open the shortcut.
Flags: needinfo?(jh+bugzilla)
Target Milestone: Firefox 58 → Firefox 59
I can confirm that this bug is fixed in the Firefox v59.0a1. Thanks everyone!
Verified as fixed on Beta 58.0b5.
Device:Samsung Galaxy Tab 3 (Android 7.0)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.