Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api.md')
-rw-r--r--docs/api.md3
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/api.md b/docs/api.md
index 5c7b8f1..bb50e4d 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -299,7 +299,6 @@ Here is a user example for browser:
const client = new WebTorrent()
const magnetURI = 'magnet: ...'
const player = document.querySelector('video')
-const scope = './'
function download (instance) {
client.add(magnetURI, torrent => {
@@ -310,7 +309,7 @@ function download (instance) {
// access individual torrents at /webtorrent/<infoHash> where infoHash is the hash of the torrent
})
}
-navigator.serviceWorker.register('./sw.min.js', { scope }).then(reg => {
+navigator.serviceWorker.register('./sw.min.js', { scope: './' }).then(reg => {
const worker = reg.active || reg.waiting || reg.installing
function checkState (worker) {
return worker.state === 'activated' && download(client.createServer({ controller: reg }))