Is there a way for a ServiceWorker (or other mechanism) to detect when resources are being downloaded?
For example, I'd like to be notified if any of the following happen:
<img src>downloads- a resource in a
background-image: url(...)downloads - A stylesheet has encountered an
@importand is fetching resources <script src>downloads- Some script invokes a new
XMLHTTPRequestorfetch
Short of hacking open the XMLHttpRequest.prototype methods, does JavaScript offer a way to listen to network activity?
It's sort of the opposite to this question about idle network activity