Skip to content

Commit

Permalink
Remove pagehide from the README examples (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton committed Jul 2, 2024
1 parent d6880fd commit 4c95f67
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,9 @@ addEventListener('visibilitychange', () => {
flushQueue();
}
});

// NOTE: Safari does not reliably fire the `visibilitychange` event when the
// page is being unloaded. If Safari support is needed, you should also flush
// the queue in the `pagehide` event.
addEventListener('pagehide', flushQueue);
```

_**Note:** see [the Page Lifecycle guide](https://developers.google.com/web/updates/2018/07/page-lifecycle-api#legacy-lifecycle-apis-to-avoid) for an explanation of why `visibilitychange` and `pagehide` are recommended over events like `beforeunload` and `unload`._
_**Note:** see [the Page Lifecycle guide](https://developers.google.com/web/updates/2018/07/page-lifecycle-api#legacy-lifecycle-apis-to-avoid) for an explanation of why `visibilitychange` is recommended over events like `beforeunload` and `unload`._

<a name="bundle-versions"><a>

Expand Down

0 comments on commit 4c95f67

Please sign in to comment.