Skip to content

Add WebSocket context cleanup steps to support BFCache#12349

Open
llannasatoll wants to merge 2 commits intowhatwg:mainfrom
llannasatoll:fix-bfcache-websocket
Open

Add WebSocket context cleanup steps to support BFCache#12349
llannasatoll wants to merge 2 commits intowhatwg:mainfrom
llannasatoll:fix-bfcache-websocket

Conversation

@llannasatoll
Copy link
Copy Markdown
Contributor

@llannasatoll llannasatoll commented Apr 9, 2026

This allows pages with active WebSockets to enter the BFCache by removing the step that marks the document as unsalvageable.

Mirroring the WebTransport integration, the user agent now invokes the WebSocket context cleanup steps (to be added in whatwg/websockets#74) on BFCache entry. This triggers a connection failure, which queues a task to fire error and close events that are dispatched only after the page is restored from the BFCache.

(See WHATWG Working Mode: Changes for more details.)


/document-lifecycle.html ( diff )
/infrastructure.html ( diff )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants