OLD | NEW |
(Empty) | |
| 1 var actual_client_id; |
| 2 |
| 3 self.onfetch = function(e) { |
| 4 // Get the subresource request from the second iframe. |
| 5 if (e.request.url.indexOf('simple.txt') != -1) { |
| 6 clients.matchAll().then(function(clients) { |
| 7 clients.forEach(function(client) { |
| 8 if (client.frameType == "nested" && |
| 9 client.url.indexOf('#2') != -1) { |
| 10 actual_client_id = client.id; |
| 11 } |
| 12 }); |
| 13 }); |
| 14 } |
| 15 }; |
| 16 |
| 17 self.onmessage = function(e) { |
| 18 var port = e.data.port; |
| 19 |
| 20 clients.get(actual_client_id).then(function(client) { |
| 21 port.postMessage(client.url); |
| 22 }); |
| 23 }; |
OLD | NEW |