LibWeb: Add most of ServiceWorker Update algorithm

This misses the final, most important part of actually creating a
service worker object and sending the script over to it in a WebWorker
process.
This commit is contained in:
Andrew Kaster 2024-10-19 12:07:24 -06:00 committed by Andrew Kaster
commit 85541f1e76
Notes: github-actions[bot] 2024-10-23 17:35:51 +00:00
5 changed files with 312 additions and 6 deletions

View file

@ -5,6 +5,9 @@
setTimeout(() => {
// We need to do this spoofing later in the event loop so that we don't end up
// telling the test runner the wrong URL in page_did_finish_loading.
// FIXME: We need to use an actual https:// domain here in order to
// actually fetch() our js file.
spoofCurrentURL("https://example.com/service-worker-register.html");
let swPromise = navigator.serviceWorker.register("service-worker.js");