Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Last active October 30, 2018 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/7e0e2dd90ed019d8a2bc9a3b997fa356 to your computer and use it in GitHub Desktop.
Save nolanlawson/7e0e2dd90ed019d8a2bc9a3b997fa356 to your computer and use it in GitHub Desktop.
Test fetch with destination within worker
<!doctype html>
<html lang="en">
<head>
<title>Test prefetch in worker</title>
</head>
<body>
<h1>Test prefetch in worker with request destination</h1>
</body>
<script>
var worker = new Worker('worker.js')
</script>
</html>
console.log("tada")
fsdsfdsdfsd
var req = new Request('library.js')
req.destination = 'script'
fetch(req).then(() => {
console.log('fetched library with fetch(), waiting 5 secods to importScripts()')
setTimeout(() => {
importScripts('library.js')
}, 5000)
})
@vickihester71
Copy link

Idk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment