mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
This patch implements the ready attribute on ServiceWorkerContainer, a Promise that resolves when there's a ServiceWorkerRegistration with an active worker for the current page. The promise never rejects and stays pending if no active service worker exists. This makes https://instagram.com/ load once again :^)
19 lines
659 B
HTML
19 lines
659 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
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.
|
|
spoofCurrentURL("https://example.com/service-worker-ready.html");
|
|
|
|
const ready = navigator.serviceWorker.ready;
|
|
|
|
println(`ready is a Promise: ${ready instanceof Promise}`);
|
|
println(`ready is the same object on second access: ${ready === navigator.serviceWorker.ready}`);
|
|
|
|
done();
|
|
}, 0);
|
|
});
|
|
</script>
|