OLD | NEW |
(Empty) | |
| 1 self.onmessage = function(e) { |
| 2 var port = e.data.port; |
| 3 var options = e.data.options; |
| 4 |
| 5 self.clients.matchAll(options).then(function(clients) { |
| 6 var message = []; |
| 7 clients.forEach(function(client) { |
| 8 var frame_type = client.frameType; |
| 9 if (client.url.indexOf('clients-matchall-include-uncontrolled.https.ht
ml') > -1 && |
| 10 client.frameType == 'auxiliary') { |
| 11 // The test tab might be opened using window.open() by the test fram
ework. |
| 12 // In that case, just pretend it's top-level! |
| 13 frame_type = 'top-level'; |
| 14 } |
| 15 message.push([client.visibilityState, |
| 16 client.focused, |
| 17 client.url, |
| 18 frame_type]); |
| 19 }); |
| 20 // Sort by url |
| 21 message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; }); |
| 22 port.postMessage(message); |
| 23 }); |
| 24 }; |
OLD | NEW |