Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Subject: Browser features description model
- //Project: Feature Policy ( https://github.com/WICG/feature-policy )
- //Related projects: https://github.com/w3c/WebAppSec
- //See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1494945
- //Author: would be anonymous
- //Version without comments: https://pastebin.com/tWqLKg7N
- interface BrowserFeature
- {
- boolean canAccessHardwareInfo;
- boolean canAccessSoftwareInfo;
- boolean canAccessLocalFilesystem;
- boolean canAccessExternalData; //camera, microphone, sensors, etc
- boolean canAccessNativeFunctions;
- boolean requiresPlugins;
- boolean isBrowserSpecific; //Vendor-specific features (non-standard)
- boolean hasOSSpecificImplementation;
- DOMString name;
- };
- interface NetworkFeature : BrowserFeature
- {
- };
- interface ContentFeature : BrowserFeature
- {
- sequence<DOMString> associatedMIMETypes;
- sequence<DOMString> associatedTagNames;
- sequence<DOMString> associatedAttributes;
- sequence<DOMString> associatedDOMProperties;
- };
- interface ProtocolSpecificNetworkFeature : NetworkFeature
- {
- sequence<DOMString> associatedURISchemes;
- };
- //Cookie, Referer, etc
- interface ProtocolHeaderFeature : ProtocolSpecificNetworkFeature
- {
- sequence<DOMString> associatedHeaderNames;
- };
- //Any content features that produce network requests
- interface ContentNetworkFeature : ContentFeature, NetworkFeature
- {
- }
- interface CSSFeature : ContentFeature
- {
- sequence<DOMString> associatedCSSProperties;
- };
- interface FeaturePermissionRule
- {
- BrowserFeature feature;
- getter boolean allowed(DOMString propertyName);
- };
- interface NetworkFeaturePermissionRule : FeaturePermissionRule
- {
- NetworkFeature feature;
- DOMString contentRequestMethod; //POST, GET, etc
- DOMString contentMIMETypeMask;
- DOMString contentSourceURIMask;
- DOMString originDomain;
- int originPort;
- DOMString originScheme;
- int frameNestingLevel;
- };
- //Each ScriptContext must have independent Global Environment
- interface ScriptContext
- {
- sequence<FeaturePermissionRule> featurePermissionRules;
- sequence<HTMLScriptElement> scripts;
- boolean derivePermissionRulesFromDocument; //derive sequence<FeaturePermissionRule> from Document
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement