This adds the basic infrastructure for the Permissions API, including the `Permissions` and `PermissionStatus` interfaces. The API is exposed via `navigator.permissions` on both `Window` and `WorkerGlobalScope`. - `is_permission_supported` is hardcoded to return false. - The `query()` method checks for a secure context but rejects all queries since no powerful features are supported yet. The permission store and permission key related methods and algorithms. Ability for the user agent to store the permissions entries. Passes a few more subtests in `permissions/`. https://wpt.live/permissions/idlharness.any.html https://wpt.live/permissions/idlharness.any.worker.html https://wpt.live/permissions/edge-cases.https.html This one behaves differently because now the `query` property is defined. And the last subtest passes for the wrong reason. "Querying "fullscreen" permission with "allowWithoutGesture" false is unsupported" but in fact everything is currently unsupported. https://wpt.live/fullscreen/api/permission.tentative.https.html permission is marked as experimental in Navigator and WorkerNavigator, so tests that now pass actually don't because the tests don't have access to the interfaces.
80 lines
3.4 KiB
Text
80 lines
3.4 KiB
Text
// https://html.spec.whatwg.org/multipage/system-state.html#navigator
|
|
[Exposed=Window]
|
|
interface Navigator {
|
|
// objects implementing this interface also implement the interfaces given below
|
|
|
|
// https://w3c.github.io/clipboard-apis/#navigator-interface
|
|
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
|
|
|
|
// https://w3c.github.io/geolocation/#navigator_interface
|
|
[SameObject] readonly attribute Geolocation geolocation;
|
|
|
|
// https://w3c.github.io/pointerevents/#extensions-to-the-navigator-interface
|
|
readonly attribute long maxTouchPoints;
|
|
|
|
// https://wicg.github.io/serial/#extensions-to-the-navigator-interface
|
|
[SameObject] readonly attribute Serial serial;
|
|
|
|
// https://html.spec.whatwg.org/multipage/interaction.html#useractivation
|
|
[SameObject] readonly attribute UserActivation userActivation;
|
|
|
|
// https://w3c.github.io/ServiceWorker/#navigator-serviceworker
|
|
[SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
|
|
|
|
// https://w3c.github.io/media-capabilities/#dom-navigator-mediacapabilities
|
|
[SameObject] readonly attribute MediaCapabilities mediaCapabilities;
|
|
|
|
// https://w3c.github.io/mediacapture-main/#dom-navigator-mediadevices
|
|
[SecureContext, SameObject] readonly attribute MediaDevices mediaDevices;
|
|
|
|
// https://w3c.github.io/webappsec-credential-management/#framework-credential-management
|
|
[SecureContext, SameObject] readonly attribute CredentialsContainer credentials;
|
|
|
|
// https://w3c.github.io/battery/
|
|
[SecureContext, Experimental] Promise<BatteryManager> getBattery();
|
|
|
|
// https://immersive-web.github.io/webxr/#navigator-xr-attribute
|
|
[SecureContext, SameObject] readonly attribute XRSystem xr;
|
|
|
|
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
|
[SameObject, Experimental] readonly attribute Permissions permissions;
|
|
};
|
|
|
|
// NOTE: As NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, and NavigatorAutomationInformation
|
|
// are not used in WorkerNavigator, we define them here.
|
|
|
|
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorcontentutils
|
|
interface mixin NavigatorContentUtils {
|
|
[FIXME, SecureContext] undefined registerProtocolHandler(DOMString scheme, USVString url);
|
|
[FIXME, SecureContext] undefined unregisterProtocolHandler(DOMString scheme, USVString url);
|
|
};
|
|
|
|
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorcookies
|
|
interface mixin NavigatorCookies {
|
|
readonly attribute boolean cookieEnabled;
|
|
};
|
|
|
|
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorplugins
|
|
interface mixin NavigatorPlugins {
|
|
[SameObject] readonly attribute PluginArray plugins;
|
|
[SameObject] readonly attribute MimeTypeArray mimeTypes;
|
|
boolean javaEnabled();
|
|
readonly attribute boolean pdfViewerEnabled;
|
|
};
|
|
|
|
// https://w3c.github.io/webdriver/#dom-navigatorautomationinformation
|
|
interface mixin NavigatorAutomationInformation {
|
|
readonly attribute boolean webdriver;
|
|
};
|
|
|
|
Navigator includes GlobalPrivacyControl;
|
|
Navigator includes NavigatorID;
|
|
Navigator includes NavigatorLanguage;
|
|
Navigator includes NavigatorOnLine;
|
|
Navigator includes NavigatorContentUtils;
|
|
Navigator includes NavigatorCookies;
|
|
Navigator includes NavigatorPlugins;
|
|
Navigator includes NavigatorConcurrentHardware;
|
|
Navigator includes NavigatorAutomationInformation;
|
|
Navigator includes NavigatorStorage;
|
|
Navigator includes NavigatorDeviceMemory;
|