Skip to content

Recognise windows-controls-overlay display mode in isStandalone() check#160696

Merged
rzhao271 merged 2 commits intomicrosoft:mainfrom
a-stewart:pwa-support-wco-display-mode
Sep 15, 2022
Merged

Recognise windows-controls-overlay display mode in isStandalone() check#160696
rzhao271 merged 2 commits intomicrosoft:mainfrom
a-stewart:pwa-support-wco-display-mode

Conversation

@a-stewart
Copy link
Contributor

This fixes #160695

Recently Chrome has started reporting the display-mode of a PWA as window-controls-overlay instead of standalone if window controls overlay is specified in this manifest file.

This causes issues with the open in new window logic (and anything that relies on isStandalone().

I think we can fix this with a slight adjustment to the matchMedia query.

image

Copy link
Collaborator

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side effect of https://bugs.chromium.org/p/chromium/issues/detail?id=1333978 right ? At first, I was under the impression that the value is only queried if app sets the display_override property which VSCode currently does not. But looking at https://chromium-review.googlesource.com/c/chromium/src/+/3849975, looks like the value follows the presence of WCO ?

@deepak1556 deepak1556 added this to the September 2022 milestone Sep 13, 2022
@a-stewart
Copy link
Contributor Author

This is a side effect of https://bugs.chromium.org/p/chromium/issues/detail?id=1333978 right ? At first, I was under the impression that the value is only queried if app sets the display_override property which VSCode currently does not. But looking at https://chromium-review.googlesource.com/c/chromium/src/+/3849975, looks like the value follows the presence of WCO ?

I don't think that vscode.dev does run with window controls overlay yet (from a quick check). But it is possible to run open source code with window controls overlay enabled as a PWA. Also if vscode web ever does support window controls overlay in the future, I think it would be good to have this fixed pre-emptively?

(I'm not sure if/how this effects vscode running with electron, although this issue will be delayed reaching electron versions.)

Copy link
Collaborator

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm not sure if/how this effects vscode running with electron, although this issue will be delayed reaching electron versions.

This change will not affect the desktop version, the code path in question is not exercised there.

@rzhao271 rzhao271 merged commit 31dc49f into microsoft:main Sep 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isStandalone() function does not recognise the new? window-controls-overlay display mode.

5 participants