Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This specification defines an API to provide Web applications with access to various properties of the system which they are running on. Specifically, properties pertaining to the device hardware are addressed. Examples include battery status, current network bandwidth. Additionally, some of those properties offer access to the environment around the device, such as ambient brightness or atmospheric pressure.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document represents the early consensus of the group on the scope and features of the proposed System Information API. Issues and editors notes in the document highlight some of the points on which the group is still working and would particularly like to get feedback.
This document was published by the Device APIs and Policy Working Group as a First Public Working Draft. This document is intended to become a W3C Recommendation. If you wish to make comments regarding this document, please send them to public-device-apis@w3.org (subscribe, archives). All feedback is welcome.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
In order for web applications to gain access to information only available to an operating system's native applications, they must be able to access various data present on the device, either related to the hardware state (e.g. CPU load), software data (e.g. pictures stored) or environment information (e.g. ambient brightness). The APIs defined by the Device APIs and Policy Working Group address this issue. Specifically, the API defined in this specification provides access to hardware devices, either internal (CPU, Thermometers) or ambient (light, noise or temperature).
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words must, must not, required, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC2119].
A Web application using this API has access to device specific data which may contain information that the user considers private. For instance a user may object to a Web application transmitting the device's CPU load to an untrusted server, or letting another application modify the device's screen brightness without the user's consent. Therefore, a conforming implementation of this specification must provide a mechanism that protects the user's privacy and this mechanism should ensure that no information exposed by this API is retrievable or modifiable without the user's express permission
User Agents must not retrieve or update system information to Web sites without the express permission of the user. User Agents must acquire permission through a user interface, unless they have prearranged trust relationships with users, as described below. The user interface must include the URI of the document origin, as defined in [HTML5]. Those permissions that are acquired through the user interface and that are preserved beyond the current browsing session (i.e. beyond the time when the browsing context, as defined in [HTML5], is navigated to another URL) must be revocable and User Agents must respect revoked permissions.
Obtaining the user's express permission to access one API method does not imply the user has granted permission for the same Web site to access other methods provided by this API, or to access the same method with a different set of arguments, as part of the same permission context. If a user has expressed permission for an implementation to, e.g. access the device's battery level, the implementation must seek the user's express permission if and when any additional function is called on this API.
Some User Agents will have prearranged trust relationships that do not require such user interfaces. For example, while a Web browser will present a user interface when a Web site performs a system information request, a widget runtime may have a prearranged, delegated security relationship with the user and, as such, a suitable alternative security and privacy mechanism with which to authorize access to system information.
This section is non-normative.
Recipients should only request system information when necessary. Recipients should only use the system information for the task for which it was provided to them. Recipients should dispose of system information once that task is completed, unless expressly permitted to retain it by the user. Recipients should also take measures to protect this information against unauthorized access. If system information is stored, users should be allowed to update and delete this information.
The recipient of system information should not retransmit the system information without the user’s express permission. Care should be taken when retransmitting and use of encryption is encouraged.
Recipients should clearly and conspicuously disclose the fact that they are collecting system data, the purpose for the collection, how long the data is retained, how the data is secured, how the data is shared if it is shared, how users can access, update and delete the data, and any other choices that users have with respect to the data. This disclosure should include an explanation of any exceptions to the guidelines listed above.
This section is non-normative.
Further to the requirements listed in the previous section, implementors of this API are also advised to consider the following aspects that can negatively affect the privacy of their users: in certain cases, users can inadvertently grant permission to the User Agent to disclose their system information to Web sites. In other cases, the content hosted at a certain URL changes in such a way that the previously granted permissions no longer apply as far as the user is concerned. Or the users might simply change their mind.
Predicting or preventing these situations is inherently difficult. Mitigation and in-depth defensive measures are an implementation responsibility and not prescribed by this specification. However, in designing these measures, implementers are advised to enable user awareness of system information sharing, and to provide easy access to interfaces that enable revocation of permissions.
A property is defined as a set of related device
characteristics. For instance, the Power
property
contains all the characteristics that relate to the device's
electrical power supply. Properties are accessible using the
functions defined by the SystemInfo
interface below. A
property is characterized by the following elements:
http://www.w3.org/2009/dap/SysInfo/
with the name of the propertyThe name of a property (or its URI, interchangeably) is
used in the functions of the SystemInfo
interface to
identify the property accessed. When a success callback
resulting from calling one of those functions is invoked, the
API must pass an instance of the property's interface.
Some of the properties below are defined as
enumerable, meaning that more than one instance of
the property's value type exist on the system. For instance, a
multi-processor system would report as many instances of
Cpu as the number of processors. When requesting the
value of an enumerable property, the id attribute of
the Options
interface is used to differentiate between
multiple instances.
The non-normative figure below illustrates the contents and relationship of all the properties defined in the following sections.
SystemInfo
interfaceThis interface contains the functions that enable access to
the properties defined in the following sections. Objects
implementing the Navigator interface (e.g. the
window.navigator
object) must also implement the
NavigatorSystem interface [NAVIGATOR]. An instance of
NavigatorSystem would then be obtained by using
binding-specific casting methods on an instance of
Navigator
.
[NoInterfaceObject]
interface SystemInfo {
PendingOp get (DOMString propertyId, SuccessCB
successCallback, optional ErrorCB
? errorCallback, optional Options
options);
PendingOp watch (DOMString propertyId, SuccessCB
successCallback, optional ErrorCB
? errorCallback, optional Options
options);
PendingOp set (DOMString propertyId, optional Object value, optional SuccessCB
successCallback, optional ErrorCB
? errorCallback);
};
get
Error
object indicating the cause of
error.
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
propertyId | DOMString | ✘ | ✘ | The URI or name of the property to retrieve. The URI of a property is the concatenation of the string |
successCallback |
| ✘ | ✘ | function called when the properties have been successfully retrieved |
errorCallback |
| ✔ | ✔ | function called when an error occurred while retrieving the properties |
options |
| ✘ | ✔ | An object containing the various options for fetching the properties requested |
PendingOp
watch
ErrorCB
object which
reflects the cause of the error.ErrorCB
object as an argument.Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
propertyId | DOMString | ✘ | ✘ | Property URI or name identifying the property to track. |
successCallback |
| ✘ | ✘ | function called when the properties have been successfully retrieved |
errorCallback |
| ✔ | ✔ | function called when an error occurred while retrieving the properties |
options |
| ✘ | ✔ | An object containing the various options for fetching the properties requested |
PendingOp
set
Error
object indicating the cause of error.
Not all property attributes can be modified. Each
property interface definitions indicates, through the
readonly
keyword whether an attribute is
allowed to be modified.
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
propertyId | DOMString | ✘ | ✘ | The URI or name of the property to retrieve. |
value | Object | ✘ | ✔ | An object containing the values to modify, as well as the id to designate which instance to modify |
successCallback |
| ✘ | ✔ | function called when the property have been successfully modified |
errorCallback |
| ✔ | ✔ | function called when an error occurred while modifying the property |
PendingOp
All functions return a PendingOp object, defined in [CORE-DEVICE], which has a cancel function allowing the asynchronous operation to be interrupted.
[Callback=FunctionOnly, NoInterfaceObject]
interface SuccessCB {
void onSuccess (optional Object obj);
};
[Callback=FunctionOnly, NoInterfaceObject]
interface ErrorCB {
void onError (Error
error);
};
[NoInterfaceObject]
interface Error {
const unsigned short PERMISSION_DENIED = 0;
const unsigned short INFORMATION_UNAVAILABLE = 1;
const unsigned short INVALID_VALUE = 2;
const unsigned short READ_ONLY = 3;
const unsigned short TIMEOUT = 4;
readonly attribute unsigned short code;
};
code
of type unsigned short, readonlyPERMISSION_DENIED
of type unsigned shortINFORMATION_UNAVAILABLE
of type unsigned shortINVALID_VALUE
of type unsigned shortOptions
object passed was invalid. For example, if the
highThreshold attribute is set to a value
greater than 1.0 for the CpuLoad property.READ_ONLY
of type unsigned shortTIMEOUT
of type unsigned shortOptions
interface[NoInterfaceObject]
interface Options {
attribute unsigned long timeout;
attribute double highThreshold;
attribute double lowThreshold;
attribute DOMString id;
};
timeout
of type unsigned longhighThreshold
of type doublelowThreshold
of type doubleid
of type DOMStringSystemDevice
interfaceThis interface gathers attributes shared by all properties describing system devices (i.e. all the enumerable properties). Examples: single battery units, CPU, or network connections.
[NoInterfaceObject, PrototypeRoot]
interface SystemDevice {
readonly attribute DOMString? info;
readonly attribute DOMString id;
};
info
of type DOMString, readonly, nullableid
of type DOMString, readonlyThe properties below expose the device's power information, either internal (battery) or external.
// Alert the user when the power level is below 20% navigator.system.watch("Power",success,null,{lowThreshold:0.2}); function success(power) { alert("Low battery level: "+power.level); };
Power
PropertyThis property reflects the general state of the system's power sources
Find the corresponding DCO properties everywhere
[NoInterfaceObject]
interface Power {
readonly attribute float? level;
readonly attribute unsigned long? timeRemaining;
readonly attribute boolean isExternal;
readonly attribute boolean isCharging;
};
level
of type float, readonly, nullabletimeRemaining
of type unsigned long, readonly, nullabletrue
, this
value must be null
, meaning that there is
essentially infinite time remaining.
isExternal
of type boolean, readonlytrue
the device is currently powered by an
external source. If false
the device is
currently powered by an internal source.
isCharging
of type boolean, readonlyfalse
,
this value must be false
, meaning that the
battery is currently powering the system, and is
therefore depleting.
This section defines interfaces that expose the system's CPU information, including type, specifications, current system load information.
//Monitor and display the CPU load navigator.system.watch("Processing",success); function success(cpu) { var s="CPU load: "+cpu.load; document.getElementById("cpuIndicator").innerHTML="CPU load: "+(cpu.load*100)+"%". }
The properties described in this section expose the system's temperature, as reported to the various internal thermometers.
// Check the thermal state and display a warning if it is above a certain level navigator.system.get("Thermal",success); function success(thermal) { if (thermal.state > 0.9) document.getElementById("tempIndicator").style.background-color = "red"; };
Thermal
propertyThis property provides information on the global temperature state of the system
[NoInterfaceObject]
interface Thermal {
readonly attribute float state;
};
state
of type float, readonlyThis interface can be used by applications to determine the state of the network interface used by the system.
// Find if the current connection is WiFi, and if so monitor its signal strength navigator.system.get("Network",success,null); function success(connection) { if (connection.type===connection.TYPE_IEEE802_11) navigator.system.watch("WifiConnection",wifiWatchCB); } function wifiWatchCB(connection) { document.getElementById(indicator, "Wireless "+connection.essid+" at "+(connection.signalStrength*100)+"%"); }
Network
PropertyThis property provides information on the system's connection to the network
[NoInterfaceObject]
interface Network {
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_ETHERNET = 1;
const unsigned short TYPE_IEEE802_11 = 2;
const unsigned short TYPE_GSM = 3;
const unsigned short TYPE_GPRS = 4;
const unsigned short TYPE_EDGE = 5;
const unsigned short TYPE_CDMA = 6;
const unsigned short TYPE_WiMAX = 7;
const unsigned short TYPE_iDEN = 8;
const unsigned short TYPE_TETRA = 9;
const unsigned short TYPE_UMTS = 10;
const unsigned short TYPE_BLUETOOTH = 11;
const unsigned short TYPE_IRDA = 12;
const unsigned short TYPE_USB = 13;
readonly attribute unsigned short type;
readonly attribute unsigned long currentDownloadBandwidth;
readonly attribute unsigned long currentUploadBandwidth;
readonly attribute unsigned long maxDownloadBandwidth;
readonly attribute unsigned long maxUploadBandwidth;
readonly attribute float? currentSignalStrength;
readonly attribute DOMString macAddress;
readonly attribute DOMString ipAddress;
readonly attribute DOMString? ESSID;
readonly attribute DOMString? apn;
readonly attribute DOMString? operatorName;
readonly attribute boolean? roaming;
};
type
of type unsigned short, readonlycurrentDownloadBandwidth
of type unsigned long, readonlycurrentUploadBandwidth
of type unsigned long, readonlymaxDownloadBandwidth
of type unsigned long, readonlymaxUploadBandwidth
of type unsigned long, readonlycurrentSignalStrength
of type float, readonly, nullablenull
if this connection is wired.macAddress
of type DOMString, readonlyipAddress
of type DOMString, readonlyESSID
of type DOMString, readonly, nullablenull
otherwise.apn
of type DOMString, readonly, nullablenull
otherwise.operatorName
of type DOMString, readonly, nullablenull
otherwiseroaming
of type boolean, readonly, nullablenull
otherwiseTYPE_UNKNOWN
of type unsigned shortTYPE_ETHERNET
of type unsigned shortTYPE_IEEE802_11
of type unsigned shortTYPE_GSM
of type unsigned shortTYPE_GPRS
of type unsigned shortTYPE_EDGE
of type unsigned shortTYPE_CDMA
of type unsigned shortTYPE_WiMAX
of type unsigned shortTYPE_iDEN
of type unsigned shortTYPE_TETRA
of type unsigned shortThe associated Connection object is a CellularConnection object.
TYPE_UMTS
of type unsigned shortThe associated Connection object is a CellularConnection object.
TYPE_BLUETOOTH
of type unsigned shortTYPE_IRDA
of type unsigned shortTYPE_USB
of type unsigned shortShould we gather all of GSM, GPRS, EDGE, CDMA, TETRA, UMTS under a singe "CELL" type? They could be differentiated by maxBandwidth, if needed.
The properties defined below expose the values of external sensors, reflecting the device's environment such as temperature, ambient brightness or ambient sound.
// Automatically adjust the screen brightness if the ambient brightness is above a certain level navigator.system.watch("AmbientLight",success, {maxThreshold: 0.9}); function success() { navigator.system.get("OutputDevices", function(devices) { for(var i=0; i<devices.displays.length; i++) navigator.system.set("Display",{id: devices.displays[i].id, brightness: 0.9}); }); }
AmbientLight
PropertyThis property provides information about the global level of ambient light around the device.
[NoInterfaceObject]
interface AmbientLight {
readonly attribute float intensity;
};
intensity
of type float, readonlyAmbientNoise
propertyThis property provides information about the global level of ambient noise around the device.
[NoInterfaceObject]
interface AmbientNoise {
readonly attribute float value;
};
value
of type float, readonlyAmbientTemperature
PropertyThis property provides information about the temperature around the device.
[NoInterfaceObject]
interface AmbientTemperature {
readonly attribute float value;
};
value
of type float, readonlyAmbientAtmosphericPressure
PropertyThis property provides information about the atmospheric pressure around the device.
[NoInterfaceObject]
interface AmbientAtmosphericPressure {
readonly attribute float pressure;
};
pressure
of type float, readonlyProximity
PropertyThis property provides information about the distance of objects around the device.
[NoInterfaceObject]
interface Proximity {
readonly attribute float distance;
};
distance
of type float, readonlyThe properties below expose the device's audio and video codec capabilities.
// Find if this device supports MIDI navigator.system.get("AVCodecs",success); function success(codecs) { for (var i=0;i<codecs.length;i++) if (codecs[i].compFormat === "MP3") { // ... use MP3 for encoding ... break; } }
AVCodecs
propertyThis property exposes information about the audio/video codecs available to this system
[NoInterfaceObject]
interface AVCodecs {
readonly attribute AudioCodec
[] audioCodecs;
readonly attribute VideoCodec
[] videoCodecs;
};
audioCodecs
of type array of AudioCodec
, readonlyvideoCodecs
of type array of VideoCodec
, readonlyAudioCodec
PropertyThis property exposes information on a single audio codec available to this system. Is it enumerable.
[NoInterfaceObject]
interface AudioCodec : SystemDevice
{
readonly attribute DOMString compFormat;
readonly attribute boolean encode;
readonly attribute boolean decode;
};
compFormat
of type DOMString, readonlyencode
of type boolean, readonlytrue
if this device supports audio
encoding, false
otherwise.decode
of type boolean, readonlytrue
if this device supports audio
decoding, false
otherwise.VideoCodec
Property[NoInterfaceObject]
interface VideoCodec : SystemDevice
{
readonly attribute sequence<DOMString> compFormats;
readonly attribute sequence<DOMString> containerFormats;
readonly attribute boolean hwAccel;
readonly attribute sequence<VideoProfile
> profiles;
readonly attribute sequence<FrameType
> frametypes;
readonly attribute sequence<RateControl
> ratetypes;
};
compFormats
of type sequence<DOMString>, readonlycontainerFormats
of type sequence<DOMString>, readonlyhwAccel
of type boolean, readonlytrue
if the codec includes hardware acceleration support, false
otherwise.profiles
of type sequence<VideoProfile
>, readonlyframetypes
of type sequence<FrameType
>, readonlyratetypes
of type sequence<RateControl
>, readonlyVideoProfile
Property[NoInterfaceObject]
interface VideoProfile {
readonly attribute DOMString name;
};
name
of type DOMString, readonlyFrameType
Property[NoInterfaceObject]
interface FrameType {
readonly attribute DOMString name;
};
name
of type DOMString, readonlyRateControl
Property[NoInterfaceObject]
interface RateControl {
readonly attribute DOMString name;
};
name
of type DOMString, readonlyThis set of properties expose a device's storage units and their properties, like type (hard Disk, memory card, etc.) and capacity
// Check each storage and warn if almost full navigator.system.get("Storage", success); function success(units) { for (var i=0;i<units.length;i++) if (units[i].capacity / units[i].availableCapacity > 0.95) alert("Storage unit '"+units[i].info+"' almost full. You may want to free some space."); }
Storage
PropertyThis property exposes the data storage devices connected to this system.
interface Storage {
readonly attribute StorageUnit
[] units;
};
units
of type array of StorageUnit
, readonlyStorageUnit
PropertyThis property exposes a single storage device connected to this system. It is enumerable.
interface StorageUnit : SystemDevice
{
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_HARDDISK = 1;
const unsigned short TYPE_FLOPPYDISK = 2;
const unsigned short TYPE_OPTICAL = 3;
const unsigned short TYPE_RAM = 4;
readonly attribute unsigned short type;
readonly attribute boolean isReadWrite;
readonly attribute unsigned long capacity;
readonly attribute unsigned long availableCapacity;
readonly attribute boolean isRemoveable;
};
type
of type unsigned short, readonlyisReadWrite
of type boolean, readonlytrue
when this device supports software modification, else
otherwise.capacity
of type unsigned long, readonlyStorageUnit
must invoke the success callback only when this attribute has changedavailableCapacity
of type unsigned long, readonlyisRemoveable
of type boolean, readonlytrue
if this unit can be removed from the system (e.g. a memory card unplugged, or a disk ejected), false
otherwiseTYPE_UNKNOWN
of type unsigned shorttype
is set to this value when the type of this device is unknown to this API.TYPE_HARDDISK
of type unsigned shortTYPE_FLOPPYDISK
of type unsigned shortTYPE_OPTICAL
of type unsigned shortTYPE_RAM
of type unsigned shortThis section gathers system properties related to this device's output devices: screens, sound systems, etc.
Do we need information about active devices, e.g. in order to be able to see which screen is currently being in use, or to control which set of speakers should be activated? If so how do we specify it? Through an "active" flag on each device (hard to watch), or through a pointer (e.g. currentDisplay in OutputDevices) which would mean only one device is active at a time, which might not always be correct in cases like several active keyboards
// Set the brightness of all the displays to their maximum value navigator.system.get("OutputDevices", function(devices) { for(var i=0; i<devices.displays.length; i++) navigator.system.set("Display",{id: devices.displays[i].id, brightness: 1}); });
OutputDevices
PropertyThis property provides information on the output devices (displays, audio) available on this system
[NoInterfaceObject]
interface OutputDevices {
readonly attribute Display
[] displays;
readonly attribute Audio[] audioDevices;
};
Display
propertyThis property exposes information on a single display device available to the system. Is it enumerable.
The Display
interface defined below inherits from the Screen interface as defined in [CSSOM-VIEW]
[NoInterfaceObject]
interface Display : Screen, SystemDevice
{
const unsigned short ORIENTATION_UNKNOWN = 0;
const unsigned short ORIENTATION_LANDSCAPE = 1;
const unsigned short ORIENTATION_PORTRAIT = 2;
const unsigned short ORIENTATION_INVERTED_LANDSCAPE = 3;
const unsigned short ORIENTATION_INVERTED_PORTRAIT = 4;
attribute unsigned short orientation;
attribute float brightness;
attribute float contrast;
attribute boolean blanked;
readonly attribute unsigned long dotsPerInchW;
readonly attribute unsigned long dotsPerInchH;
readonly attribute float physicalWidth;
readonly attribute float physicalHeight;
};
orientation
of type unsigned shortbrightness
of type floatcontrast
of type floatblanked
of type booleantrue
if this display is currently blanked, false
otherwisedotsPerInchW
of type unsigned long, readonlydotsPerInchH
of type unsigned long, readonlyphysicalWidth
of type float, readonlyphysicalHeight
of type float, readonlyORIENTATION_UNKNOWN
of type unsigned shortORIENTATION_LANDSCAPE
of type unsigned shortORIENTATION_PORTRAIT
of type unsigned shortORIENTATION_INVERTED_LANDSCAPE
of type unsigned shortORIENTATION_INVERTED_PORTRAIT
of type unsigned shortAre we being short-sighted in only listing four orientations? Would it make sense to have it be an angle, except that in most cases it would only change in 90° increments?
AudioDevice
PropertyThis property exposes information on a single audio output device available to this system. It is enumerable.
[NoInterfaceObject]
interface AudioDevice : SystemDevice
{
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_SPEAKER = 1;
const unsigned short TYPE_HEADPHONES = 2;
readonly attribute unsigned short type;
readonly attribute unsigned long freqRangeLow;
readonly attribute unsigned long freqRangeHigh;
};
type
of type unsigned short, readonlyfreqRangeLow
of type unsigned long, readonlyfreqRangeHigh
of type unsigned long, readonlyTYPE_UNKNOWN
of type unsigned shorttype
is set to this value when the type of this device is unknownTYPE_SPEAKER
of type unsigned shorttype
is set to this value when this device is a loud speakerTYPE_HEADPHONES
of type unsigned shorttype
is set to this value when this device is a set of headphonesThe properties defines below expose the input devices connected to the system (e.g. mouse, keyboard, camera).
Should we have a notion of active or selected device, e.g. which camera is currently used, or which display is the one currently drawn on. We could use current* like with Power, but that restricts to one active device at a time. Alternatively, there could be an active flag in each device. But that would make watch() messy, since we would have to extend the definition of watched events to sub-sub-field modifications
// Check if the device supports multitouch navigator.system.get("InputDevices", function(devices) { for(var i=0; i<devices.pointingDevices.length; i++) if (devices.pointingDevices[i].supportsMultiTouch) { applicationParams.hazMultiTouch = true; break; } });
InputDevices
Propertyinterface InputDevices {
readonly attribute PointingDevice
[] pointingDevices;
readonly attribute Keyboard
[] keyboards;
readonly attribute Camera
[] cameras;
readonly attribute Microphone
[] microphones;
};
pointingDevices
of type array of PointingDevice
, readonlykeyboards
of type array of Keyboard
, readonlycameras
of type array of Camera
, readonlymicrophones
of type array of Microphone
, readonlyPointingDevice
PropertyThis property exposes the pointing devices (mouse, touch screen, gesture sensor). It is enumerable.
interface PointingDevice : SystemDevice
{
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_MOUSE = 1;
const unsigned short TYPE_TOUCHSCREEN = 2;
const unsigned short TYPE_LIGHTPEN = 3;
const unsigned short TYPE_GESTURE = 4;
const unsigned short TYPE_TABLET = 5;
readonly attribute unsigned short type;
readonly attribute boolean supportsMultiTouch;
};
type
of type unsigned short, readonlysupportsMultiTouch
of type boolean, readonlytrue
when this device supports the multi-touch method of interaction, else
otherwise.TYPE_UNKNOWN
of type unsigned shortTYPE_MOUSE
of type unsigned shortTYPE_TOUCHSCREEN
of type unsigned shortTYPE_LIGHTPEN
of type unsigned shortTYPE_GESTURE
of type unsigned shortTYPE_TABLET
of type unsigned shortKeyboard
PropertyThis property exposes the keyboards and keypads connected to this system. It is enumerable.
interface Keyboard : SystemDevice
{
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_KEYBOARD = 1;
const unsigned short TYPE_KEYPAD = 2;
readonly attribute unsigned short type;
readonly attribute boolean isHardware;
};
type
of type unsigned short, readonlyisHardware
of type boolean, readonlytrue
when this device is a physical keyboard, else
if it is a software keyboard.TYPE_UNKNOWN
of type unsigned shortTYPE_KEYBOARD
of type unsigned shortTYPE_KEYPAD
of type unsigned shortCamera
PropertyThis property exposes the cameras connected to this system. It is enumerable.
interface Camera : SystemDevice
{
readonly attribute boolean supportsVideo;
readonly attribute boolean hasFlash;
readonly attribute unsigned long sensorPixels;
readonly attribute float? maxZoomFactor;
};
supportsVideo
of type boolean, readonlytrue
when this device supports recording video, else
otherwise.hasFlash
of type boolean, readonlytrue
when this device supports has a flash, else
otherwise.sensorPixels
of type unsigned long, readonlymaxZoomFactor
of type float, readonly, nullablenull
if the camera does not have a zoom (whether physical or digital)
Use focal length instead? And shutter speed/aperture/ISO/sensor type?
Microphone
PropertyThis property exposes the microphones connected to this system. It is enumerable.
interface Microphone : SystemDevice
{
const unsigned short TYPE_UNKNOWN = 0;
const unsigned short TYPE_MICROPHONE = 1;
const unsigned short TYPE_LINEIN = 2;
readonly attribute unsigned short type;
readonly attribute unsigned long freqRangeLow;
readonly attribute unsigned long freqRangeHigh;
};
type
of type unsigned short, readonlyfreqRangeLow
of type unsigned long, readonlyfreqRangeHigh
of type unsigned long, readonlyTYPE_UNKNOWN
of type unsigned shorttype
is set to this value when the type of this device is unknown to this API.TYPE_MICROPHONE
of type unsigned shorttype
is set to this value when this device is a microphoneTYPE_LINEIN
of type unsigned shorttype
is set to this value when this device is a line-in connectorThis specification allows vendor-specific properties to be made
available to the SystemInfo
interface. The URI of those
properties must not start with the string
http://www.w3.org/2009/dap/SysInfo/
.
Implementers should be aware of other standard device APIs when planning extensions, in order to avoid overlapping with existing work, in particular that of the W3C Device API and Policy Working Group.
extensibility of enumerated constants, e.g. connection types
This section is non-normative.
make a separate document?
Add examples
The use cases for this module are critical to forming a realistic picture of what kinds of information are going to be valuable for the web application that wants delivery context network information. The primary use case is: application wants to know about the network connection so that it can adjust its behavior.
The SVG Working Group would like to acknowledge the people outside of the DAP Working Group who helped with the process of developing this specification. Specifically, many thanks to Clayne Robison and Andy Idsinga at Intel Corporation for their contributions.
No informative references.