Closed Bug 1796434 Opened 2 years ago Closed 2 years ago

[Bug] PWA: window.matchMedia('(display-mode: x)').matches doesn't return the correct display-mode

Categories

(Fenix :: PWA, defect, P1)

All
Android
defect

Tracking

(firefox115 wontfix, firefox116 verified)

VERIFIED FIXED
116 Branch
Tracking Status
firefox115 --- wontfix
firefox116 --- verified

People

(Reporter: cpeterson, Assigned: m_kato)

Details

Attachments

(1 file)

From github: https://github.com/mozilla-mobile/android-components/issues/8584.

Overview

With the help of a manifest file manifest file it's possible to install a website on a device's homescreen.
To further enhance the look and feel of a 'real' application, the manifest accepts a display member which controls the display mode of the PWA. Possible values are: fullscreen, standalone, minimal-ui and browser. For this test case I've used standalone and fullscreen.

To distinguish between the installed application started using the homescreen icon and the website running inside the browser, it is recommended to query matchMedia on the window object for display-mode.

Expected behaviour

The boolean value returned by e.g. window.matchMedia('(display-mode: standalone)').matches should return true if the display member has been set to standalone in the manifest file.
Likewise window.matchMedia('(display-mode: fullscreen)').matches should be true if display has been set to fullscreen.

Actual behavior

Firefox for Android 81.0 returns false in both cases. A query for display-mode: browser always returns true even though:

  • it has been started from the home screen
  • display-mode has been set to either fullscreen or standalone

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Severity: -- → S3

I guess that a-c's onWebAppManifest doesn't call GeckoSessionSettings.displayMode after parsing manifest file.

Assignee: nobody → m_kato
Attachment #9329893 - Attachment description: GitHub Pull Request → Bug 1796434 - PWA supports display-mode media query via display value
Priority: -- → P1
Flags: needinfo?(cpeterson)
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: qe-verify+
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch

Hello, is there anything the QA Team could verify regarding the issue? Thank you!

Flags: needinfo?(m_kato)

(In reply to Andrei Mocirean from comment #5)

Hello, is there anything the QA Team could verify regarding the issue? Thank you!

I verified this on the latest Nightly. If you want to verify it, step is the following.

Step

  1. Browse https://makotokato.github.io/bugs/1796434/index.html
  2. Select [Install] from menu, then add home screen as PWA
  3. Launch [PWA test] from home screen

Expected Result

background color of PWA test is blue. Before fixing this, it was green.

Flags: needinfo?(m_kato)

Verified as fixed on the latest Nightly build (116.0a1) from 14th of June 2023.
Device used: Google Pixel 7 Pro (Android 13).

Status: RESOLVED → VERIFIED
Flags: qe-verify+

No need to uplift to 115.

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

Attachment

General

Created:
Updated:
Size: