Bug 224274 - window.closed of opened window remains false when it is closed in standalone mode
Summary: window.closed of opened window remains false when it is closed in standalone ...
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-07 01:49 PDT by chenhaoftk
Modified: 2022-02-10 11:39 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chenhaoftk 2021-04-07 01:49:27 PDT
Minimal repro: https://wuchenhao.github.io/open-window/index.html

Symptom: when a window is opened from standalone mode, its `closed` property is not updated to `true` when the window is closed.

Repro steps:
  1. Visit above URL on iPhone
  2. Add the page to home screen
  3. Open the page from home screen (page should be opened in standalone mode)
  4. Click the "Open Window" button. A blank page should be opened.
  5. Close the blank page. Observe that there is no alert window showing up - indicating that `window.closed` remains `false`.

Additional information:
  1. The issue only exists in iOS standalone mode. Also Mac Safari doesn't exhibit this issue.
Comment 1 chenhaoftk 2021-04-07 01:51:43 PDT
I would expect that `window.closed` is set to `true` after the window is closed.
Comment 2 Smoley 2021-04-07 12:16:12 PDT
Thanks for filing, this worked as expected as recently as iOS 14.2.1. I can reproduce this issue on the latest iOS 14.5 beta.
Comment 3 Radar WebKit Bug Importer 2021-04-07 12:16:25 PDT
<rdar://problem/76359684>
Comment 4 chenhaoftk 2021-04-08 03:25:50 PDT
Thanks! Also this issue can only be reproduced on real phones. Simulators do not have this problem.
Comment 5 Chris Dumez 2021-04-09 13:52:17 PDT
It appears the bug in not in WebKit but in SafariViewController. The radar has been forwarded to the SafariViewController team. Closing this WebKit bug.
Comment 6 Brent Fulgham 2022-02-10 11:39:21 PST
This should now be fixed in shipping software.