johnmichel / Library-Detector-for-Chrome

🔍 Extension that detects which JavaScript libraries are running on a page
https://chrome.google.com/webstore/detail/cgaocdmhkmfnkdkbnckgmpopcbpaaejo
MIT License
662 stars 111 forks source link

fix: better workbox detection #175

Closed patrickhulce closed 4 years ago

patrickhulce commented 4 years ago

Hi there 👋

Awesome repo! We love using it in Lighthouse :)

Two changes:

  1. Lighthouse really needs the stack collection to finish quickly, or it will mark the entire run as fatal. We can handle this just on the lighthouse side but I figured it would be generally applicable too :)
  2. The workbox detection was pretty broken in my testing as navigator.serviceWorker.controller was frequently null in practice so I updated it to fallback to the active registration script URL too.

Helpful testing page that uses workbox: https://melodic-class.glitch.me/sw-workbox.html

johnmichel commented 4 years ago

Looks great. Thanks!