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.