browser-compat-data
browser-compat-data copied to clipboard
Safari for IOS 17.3.1 does not support `beforeunload` event
MDN URL
https://developer.mozilla.org/docs/Web/API/Window/beforeunload_event
What specific section or headline is this issue about?
What information was incorrect, unhelpful, or incomplete?
The beforeunload event's compatibility data related to "Safari for iOS" is not corrected.
What did you expect to see?
The BCD shows that the event is not supported on Safari for iOS, or a note about this.
Do you have any supporting links, references, or citations
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW5
Do you have anything more you want to share
No response
MDN metadata
Page report details
- Folder:
zh-cn/web/api/window/beforeunload_event - MDN URL: https://developer.mozilla.org/zh-CN/docs/Web/API/Window/beforeunload_event
- GitHub URL: https://github.com/mdn/translated-content/blob/main/files/zh-cn/web/api/window/beforeunload_event/index.md
- Last commit: https://github.com/mdn/translated-content/commit/7d0e3ea245f84dd38b0a1b6203b4b90672d6ab07
- Document last modified: 2023-08-04T07:43:54.000Z
Hello @akylc. Could you provide additional documentation about the support of this event has been removed? The documentation currently provided may not be accurate (it is archived and may be out of date) as I was also able to find this event in the latest code of WebKit: https://github.com/search?q=repo%3AWebKit%2FWebKit%20beforeunload&type=code
it's a property exists on window by default value null (instead of undefined) in mobile Safari, see:
but it will not be fired, as it's not in the supported events table, (possibly) from the very-beginning
researching has begun since 5years ago, see: https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-the-ipad
I've tested this event on iOS 17.4.1 and failed to trigger the event handler during testing. But I can't find any recent official document showing that this event cannot be triggered.
Hey @queengooborg. Sorry to bother you, I was indeed unable to trigger the beforeunload event during my test, but I can't confirm the actual support for this event on Safari for iOS. Could you confirm this or provide some help :)
found a doc in WebKit JS: onbeforeunload | ADD, said that it's supported ever since Safari Mobile 9.0+
I found the WebKit Bug 219102 which reported the issue on Safari for IOS.
Hey @bsmth. I'm not sure what should we do for this case. Could you give any suggestions (i.e. should we provide a note for it in mdn/content or in mdn/browser-compat-data) :)
Thanks for tagging me. It looks like a BCD issue, there's some notes about mobile usage here already: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#usage_notes
Was it fully unsupported before WebKit Bug 219102 or only in certain cases? I will transfer over to BCD for now, ty.
BCD for this originally added in:
- [x] https://github.com/mdn/browser-compat-data/pull/3639
Thanks for tagging me. It looks like a BCD issue, there's some notes about mobile usage here already: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#usage_notes
Was it fully unsupported before WebKit Bug 219102 or only in certain cases? I will transfer over to BCD for now, ty.
Hi. The event was still fully unsupported till now on iOS 16. 17 and 18 Safari browsers, same on documentation of WebKit (see comment above)