Open Bug 1877996 Opened 1 year ago Updated 1 year ago

Firefox Page Lifecycle behavior inconsistent between browser and standalone web app

Categories

(Firefox for Android :: General, defect)

Firefox 122
defect

Tracking

()

UNCONFIRMED

People

(Reporter: ik, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Firefox for Android

Steps to reproduce:

  1. On Firefox for Android, open the attached test case (or go to https://testcase.rejh.nl/2024-ff-pagelifecycle/)
  2. Note that the page starts in state 'active'
  3. Go to the home screen, then back to Firefox.
  4. Note that the last state is 'active'
  5. Install ("add to home screen') and open the web app
  6. Note that the page starts in state 'passive' instead of 'active' (compared to step 2)
  7. Go to the home screen, then back to Firefox.
  8. Note that the last state is 'passive' instead of 'active' (compared to step 4)

The standalone web app reports 'active' as soon as the user interacts (e.g., scrolls) with the page, but not 'on load'.

Actual results:

Firefox reports inconsistent Page Lifecycle events. In the browser, the website/-app reports "active" on load and when the user returns to the activity, but in standalone web app mode it reports "passive".

Expected results:

I expect Firefox to fire the same events for the same website/-app, whether it's opened in the browser or as a standalone webapp.

The Bugbug bot thinks this bug should belong to the 'Fenix::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Fenix

Ah forgot to mention I use the page-lifecycle library.

See their explainer post Page Lifecycle API for more info, especially the event flowchart for which event causes which state.

(weird , I cannot reproduce that , the PWA app shows active too)

Heh, that's weird indeed. I re-tested and now I sometimes get the expected behavior (but can still repro 90% of the time). I retried the same steps in the browser, and I've just ran into the issue I describe for the standalone PWA as well :S)

Looks like the behavior of active/passive is not consistent, may not be related to diffs between browser and standalone?

The following steps reproduced the case for me 9 out of 10:

  1. Install the PWA, open it. It may say 'active' or 'passive'.
  2. Without touching anything in the document, go to the home screen (home button), then Recents (button), then tap the PWA
  3. I get 'passive' as the current state (most of the time)

See screenshot (will attach)

I can reproduce the same issue (passive instead of active) in the browser (sometimes?)

If I go through the same steps but I do touch the document (at step 2), I seem to get 'active' more often than not.

I'll update the test case to include new instructions when I have time.

The severity field is not set for this bug.
:tthibaud, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

I couldn't reproduce the bug, testing on Fenix 126.0a1.

Roderick Gadellaa can you still reproduce it?

Flags: needinfo?(tthibaud) → needinfo?(ik)
Severity: -- → S3

Sorry for the late reply.

Yes I'm still able to reproduce. Did you follow my updated steps from comment 4?
https://bugzilla.mozilla.org/show_bug.cgi?id=1877996#c4

Flags: needinfo?(ik)

Anything I can do to get this going? Thanks!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: