summaryrefslogtreecommitdiffstats
path: root/toolkit/components/antitracking/test/browser/matchAll.js
blob: 8f112b0804528bad35b51ebaa75c70ec661e6dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
});