Skip to main content

网页安全

番风Less than 1 minute

生成的网页是否包含 <script> 元素的 integrity 属性来检测 js 是否被篡改怎么添加 integrity?

构建工具或插件, 使用 webpack 的 Subresource Integrity Plugin 可以自动为所有打包的资源生成 integrity 属性.
使用 Cloudfare 这样的 CDN,他们会提供自动化添加 integrity 属性选项