問題タブ [subresource-integrity]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
83 参照

javascript - javascript を使用してクライアント側のサブリソースの整合性エラーを記録することは可能ですか?

整合性ハッシュ値が無効な場合に生成されるサブリソースの整合性エラー メッセージを傍受する方法を探しています。ページ上の JavaScript を使用してこれらのイベントを傍受する方法、またはノードに無効なintegrityプロパティがあるかどうかを検出する方法はありますか?

たとえば、次のエラー メッセージがあります。

None of the “sha384” hashes in the integrity attribute match the content of the sub-resource.

Failed to find a valid digest in the 'integrity' attribute for resource 'http://path/to/file' with computed SHA-256 integrity '[hash]'. The resource has been blocked.