这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
The HTTP
Feature-Policy
header
encrypted-media
directive controls whether the current document is allowed to use the
加密媒体扩展
API (EME). When this policy is enabled, the
Promise
returned by
Navigator.requestMediaKeySystemAccess()
will reject with a
DOMException
.
Feature-Policy: encrypted-media <allowlist>;
An
allowlist
is a list of origins that takes one or more of the following values, separated by spaces:
*
: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
'self'
: The feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin.
'src'
: (In an iframe
allow
attribute only) The feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the URL in the iframe's
src
属性。
'src'
origin is used in the iframe
allow
attribute only, and is the
default
allowlist
值。
'none'
: The feature is disabled in top-level and nested browsing contexts.
The values
*
(enable for all origins) or
'none'
(disable for all origins) may only be used alone, while
'self'
and
'src'
may be used with one or more origins.
Features are each defined to have a default allowlist, which is one of:
*
: The feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes).
'self'
: The feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. The feature is not allowed in cross-origin documents in nested browsing contexts.
'none'
: The feature is disabled in top-level and nested browsing contexts.
The allow list is
'self'
.
| 规范 | 状态 | 注释 |
|---|---|---|
| Permissions Policy | 编者草案 | 初始定义。 |
|
加密媒体扩展
The definition of 'Feature Policy integration' in that specification. |
推荐 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
encrypted-media
Experimental
|
Chrome 完整支持 60 | Edge 完整支持 79 |
Firefox
完整支持
74
|
IE 不支持 No | Opera 完整支持 48 | Safari 不支持 No | WebView Android 完整支持 60 | Chrome Android 完整支持 60 |
Firefox Android
完整支持
65
Disabled
|
Opera Android 完整支持 45 | Safari iOS 不支持 No | Samsung Internet Android 完整支持 8.0 |
完整支持
不支持
实验。期望将来行为有所改变。
用户必须明确启用此特征。
Accept
Accept-CH
Accept-CH-Lifetime
Accept-Charset
Accept-Encoding
Accept-Language
Accept-Patch
Accept-Ranges
Access-Control-Allow-Credentials
Access-Control-Allow-Headers
Access-Control-Allow-Methods
Access-Control-Allow-Origin
Access-Control-Expose-Headers
Access-Control-Max-Age
Access-Control-Request-Headers
Access-Control-Request-Method
Age
Allow
Alt-Svc
Authorization
Cache-Control
Clear-Site-Data
Connection
Content-Disposition
Content-Encoding
Content-Language
Content-Length
Content-Location
Content-Range
Content-Security-Policy
Content-Security-Policy-Report-Only
Content-Type
Cookie
Cookie2
Cross-Origin-Embedder-Policy
Cross-Origin-Opener-Policy
Cross-Origin-Resource-Policy
DNT
DPR
Date
Device-Memory
Digest
ETag
Early-Data
Expect
Expect-CT
Expires
Feature-Policy
Forwarded
From
Host
If-Match
If-Modified-Since
If-None-Match
If-Range
If-Unmodified-Since
索引
Keep-Alive
Large-Allocation
Last-Modified
Link
Location
NEL
Origin
Pragma
Proxy-Authenticate
Proxy-Authorization
Public-Key-Pins
Public-Key-Pins-Report-Only
Range
Referer
Referrer-Policy
Retry-After
Save-Data
Sec-Fetch-Dest
Sec-Fetch-Mode
Sec-Fetch-Site
Sec-Fetch-User
Sec-WebSocket-Accept
Server
Server-Timing
Set-Cookie
Set-Cookie2
SourceMap
Strict-Transport-Security
TE
Timing-Allow-Origin
Tk
Trailer
Transfer-Encoding
Upgrade-Insecure-Requests
User-Agent
Vary
Via
WWW-Authenticate
Want-Digest
警告
X-Content-Type-Options
X-DNS-Prefetch-Control
X-Forwarded-For
X-Forwarded-Host
X-Forwarded-Proto
X-Frame-Options
X-XSS-Protection
100 Continue
101 Switching Protocols
103 Early Hints
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
307 Temporary Redirect
308 Permanent Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Payload Too Large
414 URI Too Long
415 Unsupported Media Type
416 Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot
422 Unprocessable Entity
425 Too Early
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
451 Unavailable For Legal Reasons
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required
CSP: base-uri
CSP: block-all-mixed-content
CSP: child-src
CSP: connect-src
CSP: default-src
CSP: font-src
CSP: form-action
CSP: frame-ancestors
CSP: frame-src
CSP: img-src
CSP: manifest-src
CSP: media-src
CSP: navigate-to
CSP: object-src
CSP: plugin-types
CSP: prefetch-src
CSP: referrer
CSP: report-to
CSP: report-uri
CSP: require-sri-for
CSP: sandbox
CSP: script-src
CSP: script-src-attr
CSP: script-src-elem
CSP: style-src
CSP: style-src-attr
CSP: style-src-elem
CSP: trusted-types
CSP: upgrade-insecure-requests
CSP: worker-src