Greasy Fork is available in English.

議論 » Greasy Fork への意見

New feature - validation of subresource integrity hashes

§
投稿日: 2022/09/19

Subresource Integrity (SRI) is a security feature that enables browsers to verify that resources they fetch (for example, from a CDN) are delivered without unexpected manipulation. It works by allowing you to provide a cryptographic hash that a fetched resource must match.

- MDN

Tampermonkey supports subresource integrity in @require and @resource by providing the URLs in the following format:

// @require https://code.jquery.com/jquery-3.2.1.js#md5=09dd64a64ba840c31a812a3ca25eaeee,sha384=p7RDedFtQzvcp0/3247fDud39nqze/MUmahi6MOWjyr3WKWaMOyqhXuCT1sM9Q+l

If the code retrieved from https://code.jquery.com/jquery-3.2.1.js ever changes, Tampermonkey will refuse to load it as the hash will no longer match.

The new feature on Greasy Fork is that if you are using a @require or @resource with a subresource integrity hash in a script you post, Greasy Fork will monitor that URL and alert you if your hash stops matching the content at that URL.

返信を投稿

返信を投稿するにはログインしてください。