summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/match_all_properties_worker.js
blob: f007a5ce8ecc5052bdd4cd5f3e1c044924bc62ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
onmessage = function(e) {
  dump("MatchAllPropertiesWorker:" + e.data + "\n");
  self.clients.matchAll().then(function(res) {
    if (!res.length) {
      dump("ERROR: no clients are currently controlled.\n");
    }

    for (i = 0; i < res.length; i++) {
      client = res[i];
      response = {
        id: client.id,
        url: client.url,
        visibilityState: client.visibilityState,
        focused: client.focused,
        frameType: client.frameType
      };
      client.postMessage(response);
    }
  });
}