Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari for IOS 17.3.1 does not support beforeunload event #20119

Open
akylc opened this issue May 7, 2024 · 5 comments
Open

Safari for IOS 17.3.1 does not support beforeunload event #20119

akylc opened this issue May 7, 2024 · 5 comments
Labels
l10n-zh Issues related to Chinese content. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@akylc
Copy link

akylc commented May 7, 2024

MDN URL

https://developer.mozilla.org/docs/Web/API/Window/beforeunload_event

What specific section or headline is this issue about?

Browser compatibility

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
@akylc akylc added l10n-zh Issues related to Chinese content. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels May 7, 2024
@yin1999
Copy link
Member

yin1999 commented May 8, 2024

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

@jasonren0403 jasonren0403 removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 9, 2024
@yin1999 yin1999 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 12, 2024
@PassionPenguin
Copy link
Contributor

PassionPenguin commented May 15, 2024

it's a property exists on window by default value null (instead of undefined) in mobile Safari, see:

image

but it will not be fired, as it's not in the supported events table, (possibly) from the very-beginning

Screenshot 2024-05-15 at 12 25 42 PM

researching has begun since 5years ago, see: https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-the-ipad

@yin1999
Copy link
Member

yin1999 commented May 15, 2024

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.

@yin1999 yin1999 changed the title IOS 17.3.1已经不支持 beforeunload 事件了 Safari for IOS 17.3.1does not support beforeunload event May 16, 2024
@yin1999
Copy link
Member

yin1999 commented May 16, 2024

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 :)

@PassionPenguin
Copy link
Contributor

found a doc in WebKit JS: onbeforeunload | ADD, said that it's supported ever since Safari Mobile 9.0+

@yin1999 yin1999 changed the title Safari for IOS 17.3.1does not support beforeunload event Safari for IOS 17.3.1 does not support beforeunload event May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-zh Issues related to Chinese content. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

4 participants