notificationclick.serviceworker.js (607B)
1 // Any copyright is dedicated to the Public Domain. 2 // http://creativecommons.org/publicdomain/zero/1.0/ 3 4 onnotificationclick = function (e) { 5 const { 6 notification: { data, actions }, 7 action, 8 } = e; 9 10 self.clients.matchAll().then(function (matchedClients) { 11 if (matchedClients.length === 0) { 12 dump( 13 "********************* CLIENTS LIST EMPTY! Test will timeout! ***********************\n" 14 ); 15 return; 16 } 17 18 matchedClients.forEach(function (client) { 19 client.postMessage({ 20 notification: { data, actions }, 21 action, 22 }); 23 }); 24 }); 25 };