PageSourceSearch

https://winlion.com/pwa/init.js?v=1790777947341

js winlion.com collected 2026-09-30 21:02:21 UTC 677 bytes, 30 lines download raw bytes

1window.pwa = window.pwa || {};
2window.pwa.allowInstall = false;
3
4window.pwa._onInitCallbacks = [];
5window.pwa.onInit = cb => {
6  window.pwa._onInitCallbacks.push(cb);
7};
8
9window.addEventListener('beforeinstallprompt', e => {
10  e.preventDefault();
11
12  const isPromptExist = typeof e?.prompt === 'function';
13
14  const isFirstEvent = !window.pwa.allowInstall;
15  window.pwa.originalEvent = e;
16  window.pwa.allowInstall = isPromptExist;
17  window.pwa.install =
18    isPromptExist ?
19    (() => {
20      return e.prompt();
21    }): undefined;
22
23  if (isFirstEvent) {
24    window.pwa._onInitCallbacks.forEach(cb => {
25      if (typeof cb === 'function') {
26        cb();
27      }
28    });
29  }
30});

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.