[Bug] PWA: window.matchMedia('(display-mode: x)').matches doesn't return the correct display-mode
Categories
(Fenix :: PWA, defect, P1)
Tracking
(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.
Likewisewindow.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.
Comment 1•2 years ago
|
||
The severity field is not set for this bug.
:cpeterson, could you have a look please?
For more information, please visit auto_nag documentation.
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
I guess that a-c's onWebAppManifest doesn't call GeckoSessionSettings.displayMode
after parsing manifest file.
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Authored by https://github.com/makotokato
https://github.com/mozilla-mobile/firefox-android/commit/da3b94909936ce44b2f814f86cd2c66b5472401d
[main] Bug 1796434 - Part 1. Add WebAppContentFeature to set display value in the Web App Manifest.
Authored by https://github.com/makotokato
https://github.com/mozilla-mobile/firefox-android/commit/444958c482d7eccbb0ababbd8a59065ea5ead8ce
[main] Bug 1796434 - Part 2. Apply display-mode in Fenix's PWA.
Comment 5•2 years ago
|
||
Hello, is there anything the QA Team could verify regarding the issue? Thank you!
Assignee | ||
Comment 6•2 years ago
|
||
(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
- Browse https://makotokato.github.io/bugs/1796434/index.html
- Select [Install] from menu, then add home screen as PWA
- Launch [PWA test] from home screen
Expected Result
background color of PWA test is blue. Before fixing this, it was green.
Comment 7•2 years ago
|
||
Verified as fixed on the latest Nightly build (116.0a1) from 14th of June 2023.
Device used: Google Pixel 7 Pro (Android 13).
Updated•2 years ago
|
Description
•