ganar
ganar

Reputation: 691

PWA running fullscreen in Chrome Android does not honor Display-mode: standalone

Neither one of the methods used to detect standalone mode in Chrome Android work in my PWA

This is the CSS method I tried

@media all and (display-mode: standalone) {
    /* Here goes the CSS rules that will only apply if app is running standalone */
}

And this is the Javascript method (line 171-175, 297-306)

function isRunningStandalone() {
    return (window.matchMedia('(display-mode: standalone)').matches);
}
...
if (isRunningStandalone()) {
    /* This code will be executed if app is running standalone */
}

Neither one of them worked: Testing isRunningStandalone() remotely in Chrome Android returns false, even though the example works.

(example made by @josemmo here)

I have tested the code in iOS and 3 different Android Phones. iOS works perfectly.

Upvotes: 5

Views: 3034

Answers (1)

ganar
ganar

Reputation: 691

I found the solution to the problem: manifest.json has to have "display": "standalone"

"display": "fullscreen" will not work. I could not test for it either.

Upvotes: 7

Related Questions