mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Start implementing serviceWorker.register
This is mostly the fun boilerplate. Actually creating the Job queue to do the heavy lifting is next.
This commit is contained in:
committed by
Tim Ledbetter
parent
acd604c5e1
commit
c77d9a2732
@@ -0,0 +1 @@
|
||||
ServiceWorker registration failed: InternalError: TODO(ServiceWorkerContainer::start_register is not implemented in LibJS)
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
|
||||
spoofCurrentURL("https://example.com/service-worker-register.html");
|
||||
|
||||
let swPromise = navigator.serviceWorker.register("service-worker.js");
|
||||
|
||||
swPromise
|
||||
.then(registration => {
|
||||
println(`ServiceWorker registration successful with scope: ${registration.scope}`);
|
||||
done();
|
||||
})
|
||||
.catch(err => {
|
||||
println(`ServiceWorker registration failed: ${err}`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
2
Tests/LibWeb/Text/input/ServiceWorker/service-worker.js
Normal file
2
Tests/LibWeb/Text/input/ServiceWorker/service-worker.js
Normal file
@@ -0,0 +1,2 @@
|
||||
// FIXME: Add service worker code here
|
||||
console.log("hi from service worker");
|
||||
Reference in New Issue
Block a user