Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. javascript:(function()%7B(async%20()%20%3D%3E%20%7B'use%20strict'%3Btry%20%7Bconst%20manifest%20%3D%20await%20fetch('ngsw.json').then(res%20%3D%3E%20res.json())%3Bconst%20lazyUrls%20%3D%20manifest.assetGroups.find(g%20%3D%3E%20g.name%20%3D%3D%3D%20'docs-lazy').urls%3Bconst%20confirmed%20%3D%20confirm(%60Download%20all%20%24%7BlazyUrls.length%7D%20URLs%3F%60)%3Bif%20(confirmed)%20%7Bconst%20start%20%3D%20performance.now()%3Bconst%20responses%20%3D%20await%20Promise.all(lazyUrls.map(u%20%3D%3E%20fetch(u)))%3Bconst%20failedCount%20%3D%20responses.filter(r%20%3D%3E%20!r.ok).length%3Bconst%20duration%20%3D%20Math.round((performance.now()%20-%20start)%20%2F%201000)%3Balert(%60Downloaded%20%24%7BlazyUrls.length%7D%20URLs%20in%20%24%7Bduration%7Ds.%20(%24%7BfailedCount%7D%20failed.)%60)%3B%7D%7D%20catch%20(err)%20%7Bconsole.error(err)%3Balert(%60An%20error%20occurred%3A%5Cn%5Cn%24%7Berr.stack%7D%60)%3B%7D%7D)()%7D)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement