summaryrefslogtreecommitdiffstats
path: root/templates/load-webtorrent.html
blob: 0d7347f9ad18a40df3fe0624e8d7aa24d55d2b84 (plain) (blame)
1
2
3
4
5
6
7
8
9
<script type='module'>
  import WebTorrent from '/scripts/webtorrent.min.js';

  window.torrentClient = new WebTorrent();

  navigator.serviceWorker.register('/sw.min.js');
  const controller = await navigator.serviceWorker.ready;
  window.torrentClient.createServer({controller});
</script>