diff --git a/src/app.js b/src/app.js index 2c8cc29..b302804 100644 --- a/src/app.js +++ b/src/app.js @@ -44,3 +44,8 @@ window.addEventListener('load', () => { }, window.document.body) }) }) + +window.addEventListener('beforeunload', () => { + // Stop the host (and any peer hosts that it has spawned) + host.stop() +})