summaryrefslogtreecommitdiffstats
path: root/templates/load-webtorrent.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/load-webtorrent.html')
-rw-r--r--templates/load-webtorrent.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/load-webtorrent.html b/templates/load-webtorrent.html
new file mode 100644
index 0000000..0d7347f
--- /dev/null
+++ b/templates/load-webtorrent.html
@@ -0,0 +1,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>