1//push ì´ë²¤í¸ ì²ë¦¬ì´ë¤. ì¬ê¸°ìë ê°ë¨íê² ë©ìì§, icon ì²ë¦¬ì ëë§ í´ì£¼ìë¤. 2self.addEventListener("push", (event) => { 3 // eventë ìë²ìì payloadë¡ ë³´ë´ì¤ ë°ì´í°ì´ë¤. 4 let { title, body, icon, tag, sound } = JSON.parse(event.data && event.data.text()); 5 6 const options = { 7 body: body, 8 icon: icon, 9 tag: tag, 10 sound: sound // ì¬ì´ë íì¼ ê²½ë¡ 11 // sound: "https://www.oqoq.ai/videos/oq_order.mp3" // ì¬ì´ë íì¼ ê²½ë¡ 12 }; 13 14 event.waitUntil( 15 self.registration.showNotification(title || "", options) 16 ); 17 // ì´ì¸ìë ì¬ë¬ ìµì ì´ ìë¤. 18 // ì°¸ê³ : https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification 19 // event.waitUntil( 20 // self.registration.showNotification(title || "", { body, tag, icon }) 21 // ); 22}); 23 24//ì림 í´ë¦ì ìì ì´ë¤. 25self.addEventListener("notificationclick", function (event) { 26 event.notification.close(); 27 const urlToOpen = "http://oqoq.ai/main/tab/order"; 28 event.waitUntil( 29 self.clients 30 .matchAll({ 31 type: "window", 32 includeUncontrolled: true, 33 // íì¬ ìë¹ì¤ì커 í´ë¼ì´ì¸í¸ì ëì¼í originì í´ë¼ì´ì¸í¸ë¥¼ í¬í¨ìí¬ì§ ì¬ë¶.
34 // ì걸 íì±íí´ëì§ ìì¼ë©´, íì¬ ì´ë¦° íì´ ìëë¼ë ìë¹ì¤ì커를 íì±íìí¨ íì´ ìëë©´ clientì í¬í¨ëì§ ìì 35 }) 36 .then(function (clientList) { 37 // if (clientList.length > 0) { 38 // // ì´ë¯¸ ì´ë ¤ìë íì´ ìë ê²½ì° 39 // return clientList[0] 40 // .focus() 41 // .then((client) => client.navigate(urlToOpen)); 42 // } 43 return self.clients.openWindow(urlToOpen); 44 }) 45 ); 46});
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.