Skip to content

Commit 74cbf9a

Browse files
authored
Remove unload handler (#4366)
Chromium has deprecated 'unload' so this is causing a bunch of console spam on our test bots. "Permissions policy violation: unload is not allowed in this document."
1 parent 2663a2a commit 74cbf9a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/common/runtime/helper/test_worker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ function unregisterAllServiceWorkers() {
2323
// important, so we try our best (and don't worry about shutdown performance or disabling bfcache).
2424
// (We could try 'visibilitychange', but since it can happen in the middle of the page lifetime,
2525
// it is more likely to have unintended consequences and would need to do different stuff.)
26-
// - 'unload' supposedly always disables the bfcache.
27-
window.addEventListener('unload', runShutdownTasks);
26+
// - 'unload' supposedly always disables the bfcache, but is deprecated in Chrome.
2827
// - 'beforeunload' may disable the bfcache but may be called more reliably than 'unload'.
2928
window.addEventListener('beforeunload', runShutdownTasks);
3029
// - 'pagehide' won't disable the bfcache but may be called more reliably than the others.

0 commit comments

Comments
 (0)