什么是完整性和crossorigin属性? [英] What are the integrity and crossorigin attribute?

查看:484
本文介绍了什么是完整性和crossorigin属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Bootstrapcdn最近更改了他们的链接。现在看起来像这样:

Bootstrapcdn recently changed their links. It now looks like this:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" 
rel="stylesheet" 
integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" 
crossorigin="anonymous">

这些属性是什么意思?

What do these attributes mean? How do they affect the loading of the stylesheet?

推荐答案

这两个属性都已添加到Bootstrap CDN中以实现子资源完整性

Both attributes have been added to Bootstrap CDN to implement Subresource Integrity.

子资源完整性定义了一种机制,用户代理可以通过该机制验证已提取的资源未进行意外操作参考

Subresource Integrity defines a mechanism by which user agents may verify that a fetched resource has been delivered without unexpected manipulation Reference

Integrity属性是允许浏览器检查文件来源,以确保如果源文件已被处理,则不会加载代码。

Integrity attribute is to allow the browser to check the file source to ensure that the code is never loaded if the source has been manipulated.

Crossorigin属性,当'CORS'未从'同源'加载时,现在是SRI检查的要求。
关于crossorigin的更多信息

Crossorigin attribute is present when a request is loaded using 'CORS' which is now a requirement of SRI checking when not loaded from the 'same-origin'. More info on crossorigin

有关Bootstrap CDN实施的更多详情

这篇关于什么是完整性和crossorigin属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆