Bug 303619
| Summary: | [BFCache][WebSocket] don't dispatch error if websocket is closed in pagehide | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Przemyslaw Gorszkowski <pgorszkowski> |
| Component: | New Bugs | Assignee: | Przemyslaw Gorszkowski <pgorszkowski> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Przemyslaw Gorszkowski
In current implementation, when a page with open WebSocket is cached in bfCache (because of the navigation), the error event ("WebSocket is closed due to suspension.") is queued and dispatched when the page is loaded back from the bfCache.
This is intentional behaviour, but before the page is put in bfCache, the 'pagehide' event is dispatched and the page can handle it. In 'pagehide' event listener, the page can close the WebSocket, so no error should be dispatched by the browser in this case.
I have created a test for that o WPT: https://github.com/web-platform-tests/wpt/pull/56457.
I am importing it to WebKit: https://bugs.webkit.org/show_bug.cgi?id=303534.
Here I will provide a fix for that.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Przemyslaw Gorszkowski
Pull request: https://github.com/WebKit/WebKit/pull/54922
EWS
Committed 304082@main (4028de758439): <https://commits.webkit.org/304082@main>
Reviewed commits have been landed. Closing PR #54922 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/166041117>