blob: b00c9a5776a45ac09a1c8e85b763c6be572fa99f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<!DOCTYPE html>
<script>
// When told, register an unload handler that will trigger a beacon to the
// URL given by the sender of the message.
window.addEventListener('message', e => {
var url = e.data;
window.addEventListener('unload', () => {
navigator.sendBeacon(url, 'blah');
});
window.parent.postMessage('navigate-away', '*');
});
</script>
|