2013-07-12 18:35:35 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://www.whatwg.org/specs/web-apps/current-work/#the-navigator-object
|
|
|
|
* http://www.w3.org/TR/tracking-dnt/
|
|
|
|
* http://www.w3.org/TR/geolocation-API/#geolocation_interface
|
|
|
|
* http://www.w3.org/TR/battery-status/#navigatorbattery-interface
|
|
|
|
* http://www.w3.org/TR/vibration/#vibration-interface
|
2013-07-12 18:35:44 +04:00
|
|
|
* http://www.w3.org/2012/sysapps/runtime/#extension-to-the-navigator-interface-1
|
2013-07-12 18:36:32 +04:00
|
|
|
* https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
|
2014-03-06 19:51:23 +04:00
|
|
|
* http://www.w3.org/TR/beacon/#sec-beacon-method
|
2016-03-16 22:41:38 +03:00
|
|
|
* https://html.spec.whatwg.org/#navigatorconcurrenthardware
|
2016-12-16 10:50:23 +03:00
|
|
|
* http://wicg.github.io/netinfo/#extensions-to-the-navigator-interface
|
2018-01-17 05:11:44 +03:00
|
|
|
* https://w3c.github.io/webappsec-credential-management/#framework-credential-management
|
2018-01-27 22:42:17 +03:00
|
|
|
* https://w3c.github.io/webdriver/webdriver-spec.html#interface
|
2013-07-12 18:35:35 +04:00
|
|
|
*
|
|
|
|
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
|
|
|
* Opera Software ASA. You are granted a license to use, reproduce
|
|
|
|
* and create derivative works of this document.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/#the-navigator-object
|
2016-02-05 22:20:08 +03:00
|
|
|
[HeaderFile="Navigator.h"]
|
2013-07-12 18:35:35 +04:00
|
|
|
interface Navigator {
|
|
|
|
// objects implementing this interface also implement the interfaces given below
|
|
|
|
};
|
|
|
|
Navigator implements NavigatorID;
|
|
|
|
Navigator implements NavigatorLanguage;
|
|
|
|
Navigator implements NavigatorOnLine;
|
|
|
|
Navigator implements NavigatorContentUtils;
|
|
|
|
Navigator implements NavigatorStorageUtils;
|
2016-03-16 22:41:38 +03:00
|
|
|
Navigator implements NavigatorConcurrentHardware;
|
2016-06-14 15:57:36 +03:00
|
|
|
Navigator implements NavigatorStorage;
|
2018-01-27 22:42:17 +03:00
|
|
|
Navigator implements NavigatorAutomationInformation;
|
2013-07-12 18:35:35 +04:00
|
|
|
|
2014-08-05 06:20:34 +04:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
2013-07-12 18:35:35 +04:00
|
|
|
interface NavigatorID {
|
2013-11-20 18:29:01 +04:00
|
|
|
// WebKit/Blink/Trident/Presto support this (hardcoded "Mozilla").
|
2018-01-22 20:59:15 +03:00
|
|
|
[Constant, Cached, Throws]
|
2013-11-20 18:29:01 +04:00
|
|
|
readonly attribute DOMString appCodeName; // constant "Mozilla"
|
2016-11-16 01:44:43 +03:00
|
|
|
[Constant, Cached, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString appName;
|
2016-11-16 01:44:43 +03:00
|
|
|
[Constant, Cached, Throws, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString appVersion;
|
2016-11-16 01:44:43 +03:00
|
|
|
[Constant, Cached, Throws, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString platform;
|
2016-11-16 01:44:43 +03:00
|
|
|
[Pure, Cached, Throws, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString userAgent;
|
2014-09-24 20:09:50 +04:00
|
|
|
[Constant, Cached]
|
2013-11-20 18:29:01 +04:00
|
|
|
readonly attribute DOMString product; // constant "Gecko"
|
2013-07-12 18:35:35 +04:00
|
|
|
|
2013-11-20 18:29:01 +04:00
|
|
|
// Everyone but WebKit/Blink supports this. See bug 679971.
|
2015-04-15 23:33:06 +03:00
|
|
|
[Exposed=Window]
|
2013-11-20 18:29:01 +04:00
|
|
|
boolean taintEnabled(); // constant false
|
2013-07-12 18:35:35 +04:00
|
|
|
};
|
|
|
|
|
2014-09-05 18:26:34 +04:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
2013-07-12 18:35:35 +04:00
|
|
|
interface NavigatorLanguage {
|
2014-09-24 20:09:50 +04:00
|
|
|
|
2015-11-18 03:20:38 +03:00
|
|
|
// These two attributes are cached because this interface is also implemented
|
|
|
|
// by Workernavigator and this way we don't have to go back to the
|
|
|
|
// main-thread from the worker thread anytime we need to retrieve them. They
|
|
|
|
// are updated when pref intl.accept_languages is changed.
|
2014-09-24 20:09:50 +04:00
|
|
|
|
|
|
|
[Pure, Cached]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString? language;
|
2014-08-05 06:20:34 +04:00
|
|
|
[Pure, Cached, Frozen]
|
|
|
|
readonly attribute sequence<DOMString> languages;
|
2013-07-12 18:35:35 +04:00
|
|
|
};
|
|
|
|
|
2014-08-05 06:20:34 +04:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
2013-07-12 18:35:35 +04:00
|
|
|
interface NavigatorOnLine {
|
|
|
|
readonly attribute boolean onLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface NavigatorContentUtils {
|
|
|
|
// content handler registration
|
2018-02-08 20:02:48 +03:00
|
|
|
[Throws]
|
2013-07-12 18:35:35 +04:00
|
|
|
void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
|
2018-01-08 05:18:31 +03:00
|
|
|
[Pref="dom.registerContentHandler.enabled", Throws]
|
2013-07-12 18:35:35 +04:00
|
|
|
void registerContentHandler(DOMString mimeType, DOMString url, DOMString title);
|
|
|
|
// NOT IMPLEMENTED
|
|
|
|
//DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
|
|
|
|
//DOMString isContentHandlerRegistered(DOMString mimeType, DOMString url);
|
|
|
|
//void unregisterProtocolHandler(DOMString scheme, DOMString url);
|
|
|
|
//void unregisterContentHandler(DOMString mimeType, DOMString url);
|
|
|
|
};
|
|
|
|
|
2017-03-07 11:28:28 +03:00
|
|
|
[SecureContext, NoInterfaceObject, Exposed=(Window,Worker)]
|
2016-06-14 15:57:36 +03:00
|
|
|
interface NavigatorStorage {
|
2018-01-08 16:05:04 +03:00
|
|
|
[Func="mozilla::dom::DOMPrefs::StorageManagerEnabled"]
|
2016-06-14 15:57:36 +03:00
|
|
|
readonly attribute StorageManager storage;
|
|
|
|
};
|
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
[NoInterfaceObject]
|
|
|
|
interface NavigatorStorageUtils {
|
|
|
|
// NOT IMPLEMENTED
|
|
|
|
//void yieldForStorageUpdates();
|
|
|
|
};
|
|
|
|
|
2015-07-28 16:33:46 +03:00
|
|
|
partial interface Navigator {
|
2016-02-03 19:21:31 +03:00
|
|
|
[Throws]
|
2015-07-28 16:33:46 +03:00
|
|
|
readonly attribute Permissions permissions;
|
|
|
|
};
|
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
// Things that definitely need to be in the spec and and are not for some
|
|
|
|
// reason. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=22406
|
|
|
|
partial interface Navigator {
|
|
|
|
[Throws]
|
|
|
|
readonly attribute MimeTypeArray mimeTypes;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute PluginArray plugins;
|
|
|
|
};
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/tracking-dnt/ sort of
|
|
|
|
partial interface Navigator {
|
|
|
|
readonly attribute DOMString doNotTrack;
|
|
|
|
};
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/geolocation-API/#geolocation_interface
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface NavigatorGeolocation {
|
2013-07-27 00:12:12 +04:00
|
|
|
[Throws, Pref="geo.enabled"]
|
|
|
|
readonly attribute Geolocation geolocation;
|
2013-07-12 18:35:35 +04:00
|
|
|
};
|
|
|
|
Navigator implements NavigatorGeolocation;
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/battery-status/#navigatorbattery-interface
|
2015-08-21 13:29:25 +03:00
|
|
|
partial interface Navigator {
|
2016-10-29 04:45:36 +03:00
|
|
|
// ChromeOnly to prevent web content from fingerprinting users' batteries.
|
|
|
|
[Throws, ChromeOnly, Pref="dom.battery.enabled"]
|
2015-08-21 13:29:25 +03:00
|
|
|
Promise<BatteryManager> getBattery();
|
2013-07-12 18:35:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/vibration/#vibration-interface
|
|
|
|
partial interface Navigator {
|
|
|
|
// We don't support sequences in unions yet
|
|
|
|
//boolean vibrate ((unsigned long or sequence<unsigned long>) pattern);
|
2013-09-28 22:58:38 +04:00
|
|
|
boolean vibrate(unsigned long duration);
|
|
|
|
boolean vibrate(sequence<unsigned long> pattern);
|
2013-07-12 18:35:35 +04:00
|
|
|
};
|
|
|
|
|
2014-01-28 20:09:34 +04:00
|
|
|
// http://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface
|
|
|
|
partial interface Navigator {
|
|
|
|
[Pref="dom.w3c_pointer_events.enabled"]
|
|
|
|
readonly attribute long maxTouchPoints;
|
|
|
|
};
|
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
// Mozilla-specific extensions
|
|
|
|
|
2016-04-26 16:40:27 +03:00
|
|
|
// Chrome-only interface for Vibration API permission handling.
|
|
|
|
partial interface Navigator {
|
|
|
|
/* Set permission state to device vibration.
|
|
|
|
* @param permitted permission state (true for allowing vibration)
|
|
|
|
* @param persistent make the permission session-persistent
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
void setVibrationPermission(boolean permitted,
|
|
|
|
optional boolean persistent = true);
|
|
|
|
};
|
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
callback interface MozIdleObserver {
|
|
|
|
// Time is in seconds and is read only when idle observers are added
|
|
|
|
// and removed.
|
|
|
|
readonly attribute unsigned long time;
|
|
|
|
void onidle();
|
|
|
|
void onactive();
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface Navigator {
|
2016-11-16 01:44:43 +03:00
|
|
|
[Throws, Constant, Cached, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString oscpu;
|
|
|
|
// WebKit/Blink support this; Trident/Presto do not.
|
|
|
|
readonly attribute DOMString vendor;
|
|
|
|
// WebKit/Blink supports this (hardcoded ""); Trident/Presto do not.
|
|
|
|
readonly attribute DOMString vendorSub;
|
|
|
|
// WebKit/Blink supports this (hardcoded "20030107"); Trident/Presto don't
|
|
|
|
readonly attribute DOMString productSub;
|
|
|
|
// WebKit/Blink/Trident/Presto support this.
|
|
|
|
readonly attribute boolean cookieEnabled;
|
2016-11-16 01:44:43 +03:00
|
|
|
[Throws, Constant, Cached, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
readonly attribute DOMString buildID;
|
|
|
|
|
|
|
|
// WebKit/Blink/Trident/Presto support this.
|
2016-12-17 08:25:52 +03:00
|
|
|
[Throws, NeedsCallerType]
|
2013-07-12 18:35:35 +04:00
|
|
|
boolean javaEnabled();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Navigator requests to add an idle observer to the existing window.
|
|
|
|
*/
|
2016-04-21 16:48:59 +03:00
|
|
|
[Throws, ChromeOnly]
|
2013-07-12 18:35:35 +04:00
|
|
|
void addIdleObserver(MozIdleObserver aIdleObserver);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Navigator requests to remove an idle observer from the existing window.
|
|
|
|
*/
|
2016-04-21 16:48:59 +03:00
|
|
|
[Throws, ChromeOnly]
|
2013-07-12 18:35:35 +04:00
|
|
|
void removeIdleObserver(MozIdleObserver aIdleObserver);
|
|
|
|
};
|
2013-07-12 18:35:44 +04:00
|
|
|
|
2014-03-05 07:22:39 +04:00
|
|
|
// NetworkInformation
|
2013-07-12 18:35:44 +04:00
|
|
|
partial interface Navigator {
|
2014-03-05 07:22:39 +04:00
|
|
|
[Throws, Pref="dom.netinfo.enabled"]
|
|
|
|
readonly attribute NetworkInformation connection;
|
2013-07-12 18:35:44 +04:00
|
|
|
};
|
|
|
|
|
2013-07-12 18:36:32 +04:00
|
|
|
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
|
|
|
|
partial interface Navigator {
|
|
|
|
[Throws, Pref="dom.gamepad.enabled"]
|
|
|
|
sequence<Gamepad?> getGamepads();
|
|
|
|
};
|
2016-06-28 01:26:00 +03:00
|
|
|
partial interface Navigator {
|
|
|
|
[Pref="dom.gamepad.test.enabled"]
|
|
|
|
GamepadServiceTest requestGamepadServiceTest();
|
|
|
|
};
|
2013-07-12 18:36:32 +04:00
|
|
|
|
2014-07-09 23:24:49 +04:00
|
|
|
partial interface Navigator {
|
2018-01-24 21:04:34 +03:00
|
|
|
[Throws, Pref="dom.vr.enabled"]
|
2016-04-13 03:39:28 +03:00
|
|
|
Promise<sequence<VRDisplay>> getVRDisplays();
|
2016-08-12 01:57:26 +03:00
|
|
|
// TODO: Use FrozenArray once available. (Bug 1236777)
|
2018-01-24 21:04:34 +03:00
|
|
|
[Frozen, Cached, Pure, Pref="dom.vr.enabled"]
|
2016-08-12 01:57:26 +03:00
|
|
|
readonly attribute sequence<VRDisplay> activeVRDisplays;
|
2017-05-09 02:01:36 +03:00
|
|
|
[ChromeOnly, Pref="dom.vr.enabled"]
|
|
|
|
readonly attribute boolean isWebVRContentDetected;
|
|
|
|
[ChromeOnly, Pref="dom.vr.enabled"]
|
|
|
|
readonly attribute boolean isWebVRContentPresenting;
|
|
|
|
[ChromeOnly, Pref="dom.vr.enabled"]
|
|
|
|
void requestVRPresentation(VRDisplay display);
|
2014-07-09 23:24:49 +04:00
|
|
|
};
|
2017-03-01 13:33:28 +03:00
|
|
|
partial interface Navigator {
|
|
|
|
[Pref="dom.vr.test.enabled"]
|
|
|
|
VRServiceTest requestVRServiceTest();
|
|
|
|
};
|
2014-07-09 23:24:49 +04:00
|
|
|
|
2013-09-16 10:34:57 +04:00
|
|
|
callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
|
2014-10-27 22:42:56 +03:00
|
|
|
callback NavigatorUserMediaErrorCallback = void (MediaStreamError error);
|
2013-09-16 10:34:57 +04:00
|
|
|
|
2013-07-12 18:37:21 +04:00
|
|
|
partial interface Navigator {
|
2014-09-20 10:20:41 +04:00
|
|
|
[Throws, Func="Navigator::HasUserMediaSupport"]
|
|
|
|
readonly attribute MediaDevices mediaDevices;
|
|
|
|
|
|
|
|
// Deprecated. Use mediaDevices.getUserMedia instead.
|
2015-09-28 21:25:04 +03:00
|
|
|
[Deprecated="NavigatorGetUserMedia", Throws,
|
2017-12-15 01:03:14 +03:00
|
|
|
Func="Navigator::HasUserMediaSupport",
|
2017-02-01 23:43:38 +03:00
|
|
|
NeedsCallerType]
|
2013-09-16 10:34:57 +04:00
|
|
|
void mozGetUserMedia(MediaStreamConstraints constraints,
|
|
|
|
NavigatorUserMediaSuccessCallback successCallback,
|
|
|
|
NavigatorUserMediaErrorCallback errorCallback);
|
2013-07-12 18:37:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// nsINavigatorUserMedia
|
|
|
|
callback MozGetUserMediaDevicesSuccessCallback = void (nsIVariant? devices);
|
|
|
|
partial interface Navigator {
|
|
|
|
[Throws, ChromeOnly]
|
2014-04-18 22:00:16 +04:00
|
|
|
void mozGetUserMediaDevices(MediaStreamConstraints constraints,
|
2013-09-16 10:34:57 +04:00
|
|
|
MozGetUserMediaDevicesSuccessCallback onsuccess,
|
2014-02-14 23:32:58 +04:00
|
|
|
NavigatorUserMediaErrorCallback onerror,
|
|
|
|
// The originating innerWindowID is needed to
|
|
|
|
// avoid calling the callbacks if the window has
|
|
|
|
// navigated away. It is optional only as legacy.
|
2016-01-08 01:30:10 +03:00
|
|
|
optional unsigned long long innerWindowID = 0,
|
|
|
|
// The callID is needed in case of multiple
|
|
|
|
// concurrent requests to find the right one.
|
|
|
|
// It is optional only as legacy.
|
|
|
|
// TODO: Rewrite to not need this method anymore,
|
|
|
|
// now that devices are enumerated earlier.
|
|
|
|
optional DOMString callID = "");
|
2013-07-12 18:37:21 +04:00
|
|
|
};
|
2014-03-06 19:51:23 +04:00
|
|
|
|
2013-11-20 03:14:07 +04:00
|
|
|
// Service Workers/Navigation Controllers
|
|
|
|
partial interface Navigator {
|
2016-01-09 05:59:56 +03:00
|
|
|
[Func="ServiceWorkerContainer::IsEnabled", SameObject]
|
2013-11-20 03:14:07 +04:00
|
|
|
readonly attribute ServiceWorkerContainer serviceWorker;
|
|
|
|
};
|
|
|
|
|
2014-03-06 19:51:23 +04:00
|
|
|
partial interface Navigator {
|
|
|
|
[Throws, Pref="beacon.enabled"]
|
|
|
|
boolean sendBeacon(DOMString url,
|
2017-01-24 14:13:31 +03:00
|
|
|
optional BodyInit? data = null);
|
2014-03-06 19:51:23 +04:00
|
|
|
};
|
2014-08-21 13:15:18 +04:00
|
|
|
|
2015-03-19 10:48:28 +03:00
|
|
|
partial interface Navigator {
|
2016-06-03 14:50:30 +03:00
|
|
|
[Throws, Pref="dom.presentation.enabled", SameObject]
|
2015-03-19 10:48:28 +03:00
|
|
|
readonly attribute Presentation? presentation;
|
|
|
|
};
|
|
|
|
|
2015-03-25 17:36:24 +03:00
|
|
|
partial interface Navigator {
|
2016-04-21 16:48:59 +03:00
|
|
|
[NewObject, Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist"]
|
2015-03-25 17:35:59 +03:00
|
|
|
readonly attribute LegacyMozTCPSocket mozTCPSocket;
|
2015-03-25 17:36:24 +03:00
|
|
|
};
|
2015-03-25 17:35:59 +03:00
|
|
|
|
2014-11-18 12:13:02 +03:00
|
|
|
partial interface Navigator {
|
2017-02-02 09:10:06 +03:00
|
|
|
[NewObject]
|
2014-11-18 12:13:02 +03:00
|
|
|
Promise<MediaKeySystemAccess>
|
|
|
|
requestMediaKeySystemAccess(DOMString keySystem,
|
2015-10-27 04:10:51 +03:00
|
|
|
sequence<MediaKeySystemConfiguration> supportedConfigurations);
|
2014-11-18 12:13:02 +03:00
|
|
|
};
|
2015-02-18 01:10:45 +03:00
|
|
|
|
2016-03-16 22:41:38 +03:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
|
|
|
interface NavigatorConcurrentHardware {
|
|
|
|
readonly attribute unsigned long long hardwareConcurrency;
|
|
|
|
};
|
2017-01-09 23:22:49 +03:00
|
|
|
|
2018-01-17 05:11:44 +03:00
|
|
|
// https://w3c.github.io/webappsec-credential-management/#framework-credential-management
|
2017-05-23 03:09:49 +03:00
|
|
|
partial interface Navigator {
|
2018-01-17 05:11:44 +03:00
|
|
|
[Pref="security.webauth.webauthn", SecureContext, SameObject]
|
2017-05-23 03:09:49 +03:00
|
|
|
readonly attribute CredentialsContainer credentials;
|
|
|
|
};
|
2018-01-27 22:42:17 +03:00
|
|
|
|
|
|
|
// https://w3c.github.io/webdriver/webdriver-spec.html#interface
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface NavigatorAutomationInformation {
|
2018-02-09 17:57:32 +03:00
|
|
|
[Pref="dom.webdriver.enabled"]
|
2018-01-27 22:42:17 +03:00
|
|
|
readonly attribute boolean webdriver;
|
|
|
|
};
|