diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2025-02-18 20:54:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-18 20:54:09 +0100 |
commit | 7c123dec4b96e7c3ce5f5a78e828c8aa335bea98 (patch) | |
tree | 0cd8deaa2da19ea7733f0dbc13d8b75822c7e6de /.gitignore | |
parent | 047f8683cba4efa800436de9fa30e44a32c20947 (diff) | |
download | jquery-main.tar.gz jquery-main.zip |
So far, a result of an event handler has been assigned to the `returnValue`
of the original event by jQuery. Initially, one could pass a message the browser
will then display to the user. Since that got abused a lot, every browser
stopped using the provided string and they all now provide a generic message.
From the browsers supported in v4, only IE 11 would still display the message.
Incidentally, IE 11 is the only browser from our supported ones which respects
the value returned from a beforeunload handler attached by `addEventListener`;
other browsers do so only for inline handlers, so not setting the value directly
shouldn't reduce any functionality.
This looks like a good moment to stop passing the message through and just call
`event.preventDefault()` without extra checks which is shorter. This used to
not work in Chrome but it got implemented in Chrome 119.
Unfortunately, it's hard to test this event in unit tests since it blocks page
dismissal.
Closes gh-5626
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions