Timing-Allow-Origin

您正在阅读此内容的英文版本,因为该语系尚未翻译。 帮助我们翻译此文章吧!

响应头Timing-Allow-Origin用于指定特定站点,以允许其访问Resource Timing API提供的相关信息,否则这些信息会由于跨源限制将被报告为零

Header type Response header
Forbidden header name no

语法

Timing-Allow-Origin: *
Timing-Allow-Origin: <origin>[, <origin>]*

指令

*
服务器可以以“*”作为通配符,从而允许所有域都具有访问定时信息的权限。
<origin>
指定一个可以访问资源的URI。你也可以通过逗号隔开,指定多个URI。

示例

如需允许任何资源都可以看到的计时(timing)信息,你可以如此设置:

Timing-Allow-Origin: *

如需允许https://developer.mozilla.org查看你的计时信息,你可以设置:

Timing-Allow-Origin: https://developer.mozilla.org

规范

Specification Status Comment
Resource Timing Level 3
Timing-Allow-Origin
Editor's Draft Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Timing-Allow-OriginChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

参见