1self.addEventListener("install", () => { 2}); 3 4self.addEventListener("activate", (event) => { 5}); 6 7self.addEventListener("fetch", (event) => { 8}); 9 10self.addEventListener("push-token-received", async (event) => { 11 console.log("push-token-received"); 12 const token = await getCookie("token"); 13 console.log('token: ', token) 14 15 let options = {method: 'POST', headers: { 16 'Content-Type': 'application/json', 17 'firebasetoken': token 18 }, cache: 'no-store', body: JSON.stringify({ 19 deviceType: event.detail.deviceType, 20 id: event.detail.token, 21 })}; 22 23 await fetch("https://service.campanyon.com/api/office/user/device/register", options) 24 console.log('udpate token done') 25}); 26 27 28function getCookie(name) { 29 const value = `; ${document.cookie}`; 30 const parts = value.split(`; ${name}=`); 31 if (parts.length === 2) return parts.pop().split(";").shift(); 32}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.