WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
250651
display-mode: standalone matches when opening an external link with target=_blank from an installed webapp
https://bugs.webkit.org/show_bug.cgi?id=250651
Summary
display-mode: standalone matches when opening an external link with target=_b...
alex
Reported
2023-01-15 10:19:59 PST
Created
attachment 464508
[details]
`display-mode` is incorrectly `standalone` inside of the page of a website opened with an external link (target=_blank) from an installed webapp. The following evaluates to `true`: ```js window.matchMedia("(display-mode: standalone)").matches ``` for any external link (target=_blank) opened from a PWA installed to your homescreen on iOS when the manifest has `"display": "standalone"`. To reproduce: 1. Install elk.zone to your homescreen. 2. Open the following toot:
https://elk.zone/social.harding.dev/@alex/109694193072896291
3. Tap the codepen link (
https://codepen.io/aeharding/details/eYjEWEq
) 4. Observe `display-mode: standalone` evaluates to true. Expected result: I would expect it to evaluate to false. Furthermore, I'd expect `display-mode` to have a value similar to opening an external link with SFSafariViewController from a traditional mobile app like Twitter (I'd expect it to be `browser`).
Attachments
`display-mode` is incorrectly `standalone` inside of the page of a website opened with an external link (target=_blank) from an installed webapp.
(696.28 KB, image/jpeg)
2023-01-15 10:19 PST
,
alex
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
alex
Comment 1
2023-01-16 21:10:46 PST
Sorry, looks like that toot link broke. Updated elk.zone toot here:
https://main.elk.zone/social.harding.dev/@alex/109702803989162784
assuming you have
https://main.elk.zone
installed to your homescreen.
Radar WebKit Bug Importer
Comment 2
2023-01-17 08:05:11 PST
<
rdar://problem/104333829
>
David Quesada
Comment 3
2023-01-17 08:46:29 PST
Thanks for the report. I see two *potential* issues here, either of which could address this: (i.e. make it so that the display-mode doesn’t match ‘standalone’ in the opened window) 1. When the system creates a new web view to handle the opened “window”, we create that secondary web view with a WKWebViewConfiguration containing the web app’s _WKApplicationManifest. That allows the manifest (which defines the `display-mode` CSS property) to even be considered for browsing in that new window. 2. After glancing through the App Manifest spec, I noticed this wording:
> As long as the application is navigated to URLs that are within scope, the browser will continue to apply the manifest. However, navigating the web applications "out of scope" will cause the manifest to no longer be applied, and the browser will apply its own defaults.
So it seems like WebCore might be out of alignment with the spec here. Because codepen.io is not within scope of main.elk.zone, we shouldn’t consider the manifest of the web app to be applied to that individual URL. I’m pretty certain we should fix issue 2. Not sure about issue 1. (That doesn’t come into play in this particular case if we fix issue 2 -- but it would have impact if a web app decided to window.open() a URL within the scope of the application. Do we apply the manifest to the new window in that case?)
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug