mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 06:08:24 +02:00
Differential Revision: https://phabricator.services.mozilla.com/D25778 --HG-- extra : moz-landing-system : lando
13 lines
313 B
JavaScript
13 lines
313 B
JavaScript
self.addEventListener("message", async e => {
|
|
let clients = await self.clients.matchAll({type: "window", includeUncontrolled: true});
|
|
|
|
let hasWindow = false;
|
|
for (let client of clients) {
|
|
if (e.data == client.url) {
|
|
hasWindow = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
e.source.postMessage(hasWindow);
|
|
});
|