Subresource Integrity

Subresource Integrity or SRI is a W3C recommendation to provide a method to protect website delivery.

Specifically, it validates assets served by a third party, such as a content delivery network (CDN).

This ensures these assets have not been compromised for hostile purposes.

If the hashes don't match, the resource is discarded.

[1] A sample script element with integrity and crossorigin attribute used by the SRI: