Backed out 2 changesets (bug 1906804, bug 1882553) for causing artifact build bustage...
[gecko.git] / dom / serviceworkers / test / worker_updatefoundevent.js
blob96a1815ee5fa9bcb063b43581d46fa0ddf38c5f6
1 /**
2  * Any copyright is dedicated to the Public Domain.
3  * http://creativecommons.org/publicdomain/zero/1.0/
4  */
6 registration.onupdatefound = function (e) {
7   clients.matchAll().then(function (clients) {
8     if (!clients.length) {
9       // We don't control any clients when the first update event is fired
10       // because we haven't reached the 'activated' state.
11       return;
12     }
14     if (registration.scope.match(/updatefoundevent\.html$/)) {
15       clients[0].postMessage("finish");
16     } else {
17       dump("Scope did not match");
18     }
19   });