Last active
October 30, 2018 21:20
-
-
Save nolanlawson/7e0e2dd90ed019d8a2bc9a3b997fa356 to your computer and use it in GitHub Desktop.
Test fetch with destination within worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("tada") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fsdsfdsdfsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Idk