mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
10 lines
252 B
JavaScript
10 lines
252 B
JavaScript
async function broadcast(msg) {
|
|
for (const client of await clients.matchAll()) {
|
|
client.postMessage(msg);
|
|
}
|
|
}
|
|
|
|
addEventListener('fetch', event => {
|
|
event.waitUntil(broadcast(event.request.url));
|
|
event.respondWith(fetch(event.request));
|
|
});
|