FeaturePolicy
接口在
Feature Policy API
represents the set of policies applied to the current execution context.
FeaturePolicy.allowsFeature
Returns a Boolean that indicates whether or not a particular feature is enabled in the specified context.
FeaturePolicy.features
Returns a list of names of all features supported by the User Agent. Feature whose name appears on the list might not be allowed by the Feature Policy of the current execution context and/or might not be accessible because of user's permissions.
FeaturePolicy.allowedFeatures
Returns a list of names of all features supported by the User Agent and allowed by the Feature Policy. Note that features appearing on this list might still be behind a user permission.
FeaturePolicy.getAllowlistForFeature
Returns the Allow list for the specified feature.
| 规范 | 状态 | 注释 |
|---|---|---|
| Feature Policy | 编者草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
FeaturePolicy
|
Chrome
74
|
Edge 79 |
Firefox
65
Alternate Name
Disabled
|
IE No |
Opera
62
|
Safari No | WebView Android 74 |
Chrome Android
74
|
Firefox Android
65
Alternate Name
Disabled
|
Opera Android
48
Alternate Name
Disabled
|
Safari iOS No | Samsung Internet Android 11.0 |
allowedFeatures
|
Chrome
74
|
Edge 79 | Firefox 65 | IE No |
Opera
62
|
Safari No | WebView Android 74 |
Chrome Android
74
|
Firefox Android 65 |
Opera Android
48
Disabled
|
Safari iOS No | Samsung Internet Android 11.0 |
allowsFeature
|
Chrome
74
|
Edge 79 | Firefox 65 | IE No |
Opera
62
|
Safari No | WebView Android 74 |
Chrome Android
74
|
Firefox Android 65 |
Opera Android
48
Disabled
|
Safari iOS No | Samsung Internet Android 11.0 |
features
|
Chrome 74 | Edge 79 | Firefox 70 | IE No | Opera 62 | Safari No | WebView Android 74 | Chrome Android 74 | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android 11.0 |
getAllowlistForFeature
|
Chrome
74
|
Edge 79 | Firefox 65 | IE No |
Opera
62
|
Safari No | WebView Android 74 |
Chrome Android
74
|
Firefox Android 65 |
Opera Android
48
Disabled
|
Safari iOS No | Samsung Internet Android 11.0 |
完整支持
不支持
实验。期望将来行为有所改变。
用户必须明确启用此特征。
使用非标名称。