PageSourceSearch

https://lovean.jp/service-worker.js

js lovean.jp collected 2026-10-06 19:49:13 UTC 2,858 bytes, 61 lines download raw bytes

1if(!self.define){let e,t={};const n=(n,i)=>(n=new URL(n+".js",i).href,t[n]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=t,document.head.appendChild(e)}else e=n,importScripts(n),t()})).then((()=>{let e=t[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(i,s)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(t[o])return;let r={};const l=e=>n(e,o),c={module:{uri:o},exports:r,require:l};t[o]=Promise.all(i.map((e=>c[e]||l(e)))).then((e=>(s(...e),r)))}}define(["./workbox-7077d47f"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/index.html",revision:"96d57dad7a2cfda3561262b3b62b7dce"},{url:"/static/css/main.0e1a75aa.css",revision:null}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^_/,/^.+.html.*/,/^column\/.*/,/^campaign\/.*/,/\/[^/]+\.[^/]+$/]}))}));
2//# sourceMappingURL=service-worker.js.map
3
4self.addEventListener("push", function (event) {
5  if (event.data) {
6    console.log('This push event has data: ', event.data.text());
7    const dataJson = event.data.json();
8    const promiseChain = self.registration.showNotification(dataJson.title, {
9      body: event.data.json().body,
10      icon: "notification/icon.png",
11      badge: "notification/badge.png",
12      image: dataJson.image? dataJson.image : undefined,
13      data: dataJson,
14    });
15    if(dataJson.badge){
16      if (navigator.setAppBadge) {
17        navigator.setAppBadge(dataJson.badge);
18      }
19    }
20    event.waitUntil(promiseChain);
21  } else {
22    console.log('This push event has no data.');
23  }
24});
25self.addEventListener('notificationclick', function (event) {
26  event.notification.close();
27  if (navigator.setAppBadge) {
28    navigator.setAppBadge(0);
29  }
30  var url = "/";
31  var hasUrl = false;
32  if (event.notification.data.url) {
33    url = event.notification.data.url;
34    hasUrl = true;
35  }
36  const urlToOpen = new URL(url, self.location.origin).href;
37  const promiseChain = clients
38    .matchAll({
39      type: 'window',
40      includeUncontrolled: true,
41    })
42    .then((windowClients) => {
43      let matchingClient = null;
44      for (let i = 0; i < windowClients.length; i++) {
45        const windowClient = windowClients[i];
46        if (windowClient.url === urlToOpen) {
47          matchingClient = windowClient;
48          break;
49        }
50      }
51      var userAgent = navigator.userAgent || '';
52      var isiOS = userAgent.indexOf("iPhone") !== -1 || userAgent.indexOf("iPad") !== -1 || userAgent.indexOf("iPod") !== -1;
53      var forceOpen = hasUrl && isiOS;
54      if (matchingClient && !forceOpen) {
55        return matchingClient.focus();
56      } else {
57        return clients.openWindow(urlToOpen);
58      }
59    });
60  event.waitUntil(promiseChain);
61});

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.