mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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:
parent
acd604c5e1
commit
c77d9a2732
Notes:
github-actions[bot]
2024-09-20 21:42:18 +00:00
Author: https://github.com/ADKaster
Commit: c77d9a2732
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1404
Reviewed-by: https://github.com/tcl3 ✅
7 changed files with 163 additions and 1 deletions
|
@ -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");
|
Loading…
Add table
Add a link
Reference in a new issue