Subresource Integrity and Service Worker

Service Worker

This demo page illustrates how Service Worker works with Subresource Integrity. Different from previous demo, resources on this page are not inserted into DOM tree by JavaScript.

For Chrome, Service Worker is not able to catch the error thrown by mismatch of hashes, and integrity attribute in request is also empty. On the other hand, Firefox is able to treat both the same, meaning that it will as well catch the error and attempt to use backup resource instead when dealing with embedded resources. Safari is a bit weird, it will treat stylesheet and script differently. Safari can successfully handle loading of stylesheet, but is not able to do the same for script.

Status of resources loading

Back