Re: [w3c/editing] [Delayed Clipboard Rendering] What happens to the clipboard data on Tab/Browser Close? (Issue #424)

> Moreover, it's also detrimental to the performance of the site if there is a beforeunload event listener attached as it would disable bfcache.

Chrome and Safari do not block BFCache on `beforeunload`, only Mozilla does. That is not specced behaviour and as far as I am aware it is an implementation detail that Mozilla could address if they chose to, there's nothing that makes `beforeunload` incompatible with BFCache and use of `beforeunload` is not particularly discouraged in dev documentation. That said, it seems like the handler would have to generate the clipboard data synchronously *before* the prompt was display.

Perhaps the `pagehide` event would be a better choice. I doesn't block anything, there is no user interruption, you would just generate the data in the background (although on Chrome and maybe other engines, if you were navigating from `a.com/foo` to `a.com/bar` the navigation would be blocked until the `pagehide` handler completed as both pages would share a renderer).



-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/424#issuecomment-1545004223
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/424/1545004223@github.com>

Received on Friday, 12 May 2023 02:10:13 UTC