mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 04:09:03 +02:00
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36052 --HG-- extra : source : b5be5b4f4b47c256e28a29f665dc754f6407ee7f
16 lines
326 B
JavaScript
16 lines
326 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);
|
|
});
|