4 ms·
It's called Subresource Integrity, see https://hacks.mozilla.org/2015/09/subresource-integrity-in-firefox-43/ https://hacks.mozilla.org/2015/09/subresource-inte
by gog 10y ago
It's called Subresource Integrity, see https://hacks.mozilla.org/2015/09/subresource-integrity-in-firefox-43/ https://hacks.mozilla.org/2015/09/subresource-integrity-in-f... and https://www.w3.org/TR/SRI/ https://www.w3.org/TR/SRI/
Browser support is noted here: http://caniuse.com/#feat=subresource-integrity http://caniuse.com/#feat=subresource-integrity
- blitmap 10y agoIt's kind of a shame they didn't let their imagination fly with that one... I wish integrity were a global attribute, because I could totally see using it for things like images and audio/video.
- Ajedi32 10y agoIt might work (though I'm not completely sure) if you specify a hash in the img-src directive of the CSP header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Co... Another option would be to just use a subresource-integrity protected script to check the hash of a downloaded image/video before displaying it.
- blitmap 10y agoThat is clever and I like you.
- StavrosK 10y agoAnd then any site could check whether you've seen a particular image before just by including it and seeing how long it takes to load, yay!