Last active
October 28, 2020 09:13
-
-
Save codebubb/917e0bd88ecf5a69cc2a8b411e8df4bc to your computer and use it in GitHub Desktop.
Beacon and Page Visibility API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener('unload', async () => { | |
| await fetch('/log', { method: 'POST', body: JSON.stringify({ data: 'test' }) }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment