The Device APIs Working Group is currently not pursuing the approach outlined in this draft, so it should be considered historical. Please treat this document with caution and do not reference it or use it as the basis for implementation. The domain covered by this document is still within the scope of the Working Group as defined in its Charter. The Working Group may pursue an alternative API design that is based on the current Web browser security model.

This specification defines an API to provide Web applications with access to various properties of the system on which they are running. Specifically, properties pertaining to device information are exposed. Examples of such properties include battery status, current network connection characteristics, and I/O properties. Additionally, some of those properties offer access to the environment around the device, such as ambient brightness or atmospheric pressure.

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.

Introduction

In order for web applications to gain access to information that is typically available to an operating system's native applications, they must be able to access various system properties present on the device, either related to the hardware state (e.g. CPU usage), software data (e.g. installed codecs) 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 System Information and properties from the underlying platform related to Input/Output, AVCodecs, Network, Storage, Sensors, and other Internal device properties. The properties accessed through this API may be static and/or dynamic in nature.

Security and Privacy Considerations

The API defined in this specification can be used to access properties of the user's device and its current context. The distribution of this information could potentially compromise the user's privacy. A conforming implementation of this specification must provide a mechanism that protects the user's privacy and this mechanism should ensure that no system information is retrievable without the user's express permission.

Privacy considerations for implementors of the System Info API

To provide the user with some control over which properties should be exposed, without overwhelming the user with a complex set of choices, this specification groups the properties so users can decide what to make available at least at a group level. The groups are defined below.

Device Characteristics (data points that describe features or limits of the user's device), including:

Sensor Results (data points that describe things about the user's environment external to the device), including:

Network Characteristics (data points that describe features or limits of the network connection(s) that is available to the device), including:

A user agent MUST NOT provide any system information related to these property groups to Web sites without the express permission of the user. A user agent MUST acquire permission through a user interface, unless they have prearranged trust relationships with users, as described below. The user interface MUST include the origin of the document in whose context the callback will be invoked. 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 a user agent MUST respect revoked permissions.

Obtaining the user's express permission to access one device property group does not imply a grant of permission for the same Web site to access other property groups via this API, as part of the same permission context. The implementation MUST seek the user's express permission when any access is sought to property groups for which the user has not yet expressed permission.

A user agent MUST separately acquire permission through the user interface when the callback is invoked in the context of a document object that is presented in a nested browsing context, if the origin of the nested browsing context is different from the top-level browsing context's origin. In this case, the permission MUST be scoped to the pair consisting of the top-level browsing context's origin, and the origin within which the callback is executed.

Example: Alice has granted a persistent permission for an API to be accessed by www.example.com. Alice now navigates to evil.example.net, which includes www.example.com within an iframe. In this case, the user agent must separately obtain authorization from the user, since the API is used within a nested browsing context (the iframe ).

A user agent may 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 the access to system information.

For the monitor method, distinct permission to monitor properties MUST be granted, and a maximum monitor period MUST be applied by the user agent. When requesting the user's express permission for use of the monitor method, the user agent MUST clearly indicate that this provides ongoing access to the monitored property, as compared to a one-shot access.

Additional security considerations might apply in the use of the APIs defined in this specfication for collection of quantitative data or from high performance data sources, to avoid side-channel attacks (e.g. sampling AmbientNoise fast enough to be able to interpolate a microphone).

Additional implementation considerations

This section is non-normative.

Further to the requirements listed in the previous section, implementors of the System Info 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 minds.

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.

API Description & Properties

System Properties

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:

The name of a property (or its URI, interchangeably) is used in the functions of the SystemInfo interface to identify the accessed property. The name of a property or its URI are equivalent for identifying the property. Character-per-character comparison will be used while matching for property, without any normalization. In response to calling one of those functions, the resulting property MUST be an instance of the property's interface i.e. an instance of the WebIDL interface that contains its attributes.

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 system with more than one hard disk would report one instance of StorageUnit for each disk. When requesting (through calls to the get() or monitor() functions) the value of an enumerable property, the success callback function will be passed an array of the property object, one for each property item. However, if an identifier is passed to the request, through the id attribute of the options parameter, then only the property object with that identifier will be returned.

The non-normative figure below illustrates the contents and relationship of all the properties defined in the following sections.

graphical representation of the property structure
(View as SVG)

The SystemInfo interface

This 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.

attribute SystemInfo system
The root node from which the system information functionality can be accessed.
PendingOp get()
This function retrieves the current state of a given system property. When called, the function MUST immediately return and asynchronously acquire the current state of the requested property. If it is successful the success callback MUST be invoked and return
  • If this property is not enumerable, an instance of the object associated to this property.
  • Otherwise, an array of such instances.
For instance, requesting the property "Power" will yield an instance of the Power object, while requesting the property "StorageUnits" will return an array of StorageUnit objects, since the property is enumerable. If an error occurs, and an errorCallback function was passed to the function invocation, it is called and is passed an Error object indicating the cause of error.
DOMString propertyId
The URI or name of the property to retrieve.
SuccessCB successCallback
Function called when the properties have been successfully retrieved.
optional ErrorCB errorCallback
Function called when an error occurred while retrieving the properties.
optional Options options
An object containing the various options for fetching the property requested.
PendingOp monitor()
The monitor() function allows tracking the change of one or several system properties. When called, it immediately returns and then asynchronously starts a monitoring process defined as the following set of steps:
  1. Acquire the system's current values for the property requested. If successful invoke the associated successCallback, passing the resulting property value an object of the type indicated by the property's value type in the definitions below. If the attempt fails, and the method was invoked with a non-null errorCallback argument, this method invokes the errorCallback, passing an ErrorCB object which reflects the cause of the error.
  2. Register to receive system events that indicate that the status of the requested properties may have changed.
  3. When a system event is successfully received, invoke the associated successCallback, passing an object containing the property values (or an array of such objects, if the property is enumerable). If an error occurs and the method was invoked with a non-null errorCallback argument, this method MUST invoke the errorCallback with an ErrorCB object as an argument.
  4. Repeat the previous step until the cancel method of the PendingOp object returned by this monitor() function is invoked.
DOMString propertyId
Property URI or name identifying the property to track.
SuccessCB successCallback
Function called when the properties have been successfully retrieved.
optional ErrorCB errorCallback
Function called when an error occurred while retrieving the properties.
optional Options options
An object containing the various options for fetching the properties requested.
boolean has()
This function is used to determine if the user agent supports a specific property, whose name or URI is passed as a parameter. It MUST return true if the user agent is able to report the value of a property, and false otherwise.
DOMString propertyId
The URI or the name of the property to check.

All functions except has() return a PendingOp object, defined in [[!CORE-DEVICE]], which includes a cancel() function allowing the asynchronous operation to be stopped.

This version of the specification supports read-only access to properties. A further version may introduce read-write functionality (for instance, through as a set function) for certain properties. Examples would include screen brightness, active loudspeaker or camera aperture.

Callback interfaces

void onSuccess()
optional Object obj
The return object of a successful asynchronous operation.
void onError()
Error error
The error object of an unsuccessful asynchronous operation.

The Error interface

const unsigned short PERMISSION_DENIED = 1
The application context does not have permission to access this property.
const unsigned short INFORMATION_UNAVAILABLE = 2
The property accessed is either unknown or unavailable on this device (e.g. the battery level on a device that only has an external power source).
const unsigned short INVALID_VALUE = 3
One or more of the values in the Options object passed was invalid. For example, if the highThreshold attribute is set to a value greater than 1.0 for the CPU property.
const unsigned short TIMEOUT = 4
The length of time specified by the timeout option has elapsed before the implementation could successfully retrieve the requested property.
attribute unsigned short code
The code attribute SHOULD contain one of the error values defined in this specification. An implementation MAY define additional error codes, but those MUST NOT use the numeric values defined here.

The Options interface

attribute double highThreshold
This attribute has no effect on the get() method. On the monitor() method, it indicates that the successCallback is only be triggered if the property is a number and its value is greater than or equal this number.
attribute double lowThreshold
This attribute has no effect on the get method. On the monitor() method, it indicates that the successCallback is only be triggered if the property is a number and its value is lower than or equal this number. If both highThreshold and lowThreshold parameters are specified, the success callback is triggered if and only if the property value is either lower than the value of lowThreshold or higher than the value of highThreshold.
attribute DOMString thresholdTarget
This option specifies which attribute of the requested property is to be considered for thresholds in a monitor() operation. The value of thresholdTarget must be the name of an attribute marked as threshold target in its definition. If the value passed is not the name of an attribute that is defined as a threshold target, a user agent MUST call the error callback with the INVALID_VALUE code.
attribute unsigned long timeout
The timeout attribute denotes the maximum length of time (expressed in milliseconds) that is allowed to pass from the call to monitor() until the corresponding success callback is invoked. If the implementation is unable to successfully acquire a value before the given timeout elapses, and no other errors have occurred in this interval, then the corresponding error callback must be invoked with an Error object whose code attribute is set to TIMEOUT. Note that the time that is spent obtaining the user permission is not included in the period covered by the timeout attribute.
attribute DOMString id
In order to differentiate between instances, this attribute is used to indicate the request's target instance. The list of available identifiers would normally be retrieved first through querying the relevant property (e.g. the sources attribute of CpuState). If a property requested does not support multiple instances and an id parameter is passed, then it MUST be ignored. If a property does support multiple instances and an id parameter is passed that does not correspond to any existing instance, then the error callback MUST be called with a code set to INVALID_VALUE.

The SystemProperty interface

This interface gathers attributes shared by all properties.

attribute DOMString? info
A free-form string describing an instance of a system property, e.g. the name of a CPU manufacturer.
attribute DOMString? id
A free-form string identifying an instance of a system property. If the property is enumerable, the value of this attribute MUST be unique within the list reported in the object enumerating the device (e.g. the microphones attribute of the InputDevices property). If the instance is that of a non-enumerable property (e.g. CPU or AmbientNoise, the attribute MAY be null.

Power

The properties below expose the device's power information, either internal (battery) or external.

ECMAScript Example

// Alert the user when the power level is below 20%

if (navigator.system.has("Power"))
  navigator.system.monitor("Power",success,null,{lowThreshold:0.2, thresholdTarget:"level"});

function success(power) {
  alert("Low battery level: "+power.level);
};

The Power Property

This property reflects the general state of the system's power sources. The information provided when requesting this property is described by the PowerAttributes interface.

attribute float? level
Specifies how much of the internal power source remains, scaled from 0 to 100. A value of 0 indicates that the system's battery is depleted, i.e. it is about to be suspended. A value of 100 indicates that the system's charge is maximal. A value of null indicates that the API is unable to report the battery's level. Any threshold parameter used in a monitor() function to monitor this property applies to this attribute. This attribute can be used as a threshold target.
attribute unsigned long? timeRemaining
Represents the estimated time remaining in seconds before the battery will be depleted, based upon current power usage. If batteryBeingCharged is true, this value represents the estimated time remaining in seconds before the battery is depleted, based upon current power usage, if external power were removed. This attribute can be used as a threshold target.
attribute boolean isBattery
Indicates whether the current power source is a battery. This attribute must be true if the device is currently powered by a battery, and false otherwise.
attribute boolean isCharging
Indicates whether the device's battery, if in use, is currently charging. The attribute must be true if the current power source is a battery and it is being charged, and false otherwise.

CPU

This section defines interfaces that expose the system's CPU information: description and current usage information.

ECMAScript Example

//Monitor and display the CPU usage

navigator.system.monitor("CPU",success);

function success(cpu) {
  var s="CPU usage: "+cpu.usage;
  document.getElementById("cpuIndicator").innerHTML="CPU usage: "+(cpu.usage*100)+"%".
}

The CPU Property

This property reflects the state of the CPUs available to this system. The information provided when requesting this property is described by the CPUAttributes interface.

attribute float usage
This attribute indicates the current CPU usage, as a number between 0.0 and 1.0, representing the minimum and maximum values allowed on this system. Any threshold parameter used in a monitor() function to monitor this property applies to this attribute. This attribute can be used as a threshold target.

Thermal

The properties described in this section expose the system's temperature, as reported to the various internal thermometers.

ECMAScript Example

// Show the thermal status as an SVG analog dial

navigator.system.monitor("Thermal",success);

function success(thermal) {
  document.getElementById("GaugeHand").setAttribute("transform","rotate("+thermal.state*360+")");
};

The Thermal property

This property provides information on the global temperature state of the system. The information provided when requesting this property is described by the ThermalAttributes interface.

attribute float state
This attribute indicates the current thermal status, as a number between 0 and 1 representing the minimum and maximum operating values allowed by this system. On devices that have multiple thermometers, this implementation-defined value should reflect the global temperature of the system. This attribute can be used as a threshold target.

Network

These properties can be used by applications to determine the state of the network connections used by the system.

ECMAScript Example

// Find the first of the current connections that is on WiFi, and if so monitor its signal strength
navigator.system.get("Network",success,null);

function success(network) {
  var activeConnections = network.activeConnections;
  for (var i=0; i < activeConnections.length; i++) {
    var active = activeConnections[i];
    if (active.type === active.TYPE_WIFI) {
      navigator.system.monitor("Connection", {id: active.id}, wifiMonitorCB);
      // wifiMonitorCB is a user defined function that would 
      // monitor the signal strength
      break;
    }
  }
}

function wifiMonitorCB(connection) {
  document.getElementById(indicator).innerHTML = "Wireless signal at " + connection.currentSignalStrength*100 + "%";
}

The Network Property

This property exposes the network connections that are available on this system. The information provided when requesting this property is described by the NetworkAttributes interface.

attribute Connection activeConnections[]
The list of only network connections currently used for network access.

The Connection Property

This property exposes a network connection which is available on this system. The information provided when requesting this property is described by the ConnectionAttributes interface.

attribute DOMString type
The type of network connection. The value is one of
  • "unknown" if the type of this connection is unknown.
  • "ethernet" if this is an Ethernet connection.
  • "usb" if this is a connection over a USB port.
  • "wifi" if this is a Wi-Fi connection (i.e. IEEE802.11).
  • "wimax" if this is a WiMax connection (i.e. IEEE802.16).
  • "2g" if this is a 2G connection (e.g. GSM, GPRS, EDGE).
  • "3g" if this is a 3G connection (e.g. UMTS, CDMA).
  • "4g" if this is a 4G connection (e.g. LTE, UMB).

Updates of this specification may standardize more values. In the meantime vendors may define non-standard values, but must use the prefix x-.

attribute unsigned long currentDownloadBandwidth
The current real-time download bandwidth, in Kbits/s. This attribute can be used as a threshold target.
attribute unsigned long currentUploadBandwidth
The current real-time upload bandwidth, in Kbits/s. This attribute can be used as a threshold target.
attribute unsigned long maxDownloadBandwidth
This property represents the maximum download bandwidth offered by this network connection, measured in Kbits/s.
attribute unsigned long maxUploadBandwidth
This property represents the maximum upload bandwidth offered by this network connection, measured in Kbits/s.
attribute float currentSignalStrength
This connection's signal strength, as a normalized value between 0 (no signal detected) and 1 (the level is at its maximum value). This attribute can be used as a threshold target.
attribute boolean roaming
Indicates if this connection is roaming. A value of true indicates that the connection is roaming, while false indicates that it is not roaming.

Sensors

The properties defined below expose the values of external sensors, reflecting the device's environment such as temperature, ambient brightness or ambient sound.

ECMAScript Example

// Automatically adjust the UI colors if the ambient light gets too bright

navigator.system.monitor("AmbientLight",success, null, {highThreshold: 0.9, thresholdTarget:"normalizedValue"});

function success() { 
  setColorScheme('bright');  // user-defined function to set color scheme of the desktop
}

The SensorAttributes interface

The SensorAttributes interface is used as a general interface for sensor values. All the success callbacks for the properties defined in this section return an instance of this interface, with attribute values corresponding to the measurement leading to the callback being invoked.

attribute float? value
The numerical value of this sensor, at the time of sampling. Details on the meaning of the number and reported as well as its unit are given for each sensor property defined below. This attribute can be used as a threshold target.
attribute float? min
The minimum value that the sensors measuring the property are able to report.
attribute float? max
The maximum value that the sensors measuring the property are able to report.
attribute float? normalizedValue
The numerical value of this sensor, at the time of sampling, normalized on a 0 to 1 scale, where 0 represents the minimum value that the sensor can report and 1 the maximum value. This attribute can be used as a threshold target.

For an instance of SensorAttributes returned by a callback function, either value or normalizedValue can be null, but at least one MUST be non-null. normalizedValue is meant to be used when the API is not able to report a sensor value in the unit specified in this document. In that case, value stays null and normalizedValue is assigned a value which represents a unit-less measurement, between the minimum and maximum values that the device supports.

Some sensors may only be able to report two values, e.g. corresponding to "near" or "far" in the case of a proximity sensor. In that case, the normalizedValue is set to 0 for the lowest of the two values and to 1 for the greatest.

Ambient Light

The AmbientLight Property

This property provides information about the global level of ambient light around the device.

  • value represents the measured ambient light around the device, i.e. the illuminance, in lux.
  • min represents the minimum illuminance that the device's ambient light sensors can report, in lux.
  • max represents the maximum illuminance that the device's ambient light sensors can report, in lux.
  • normalizedValue represents the measured illuminance normalized to a 0 to 1 range.

Ambient Noise

The AmbientNoise property

This property provides information about the global level of ambient noise around the device.

  • value represents the measured ambient noise around the device, in decibels.
  • min represents the minimum ambient noise level that this device's sensors can report, in decibels.
  • max represents the maximum ambient noise level that this device's sensors can report, in decibels.
  • normalizedValue represents the measured ambient noise level, normalized to a 0 to 1 range.

Ambient Temperature

The AmbientTemperature Property

This property provides information about the temperature around the device.

  • value represents the measured ambient temperature around the device, in degrees Celsius.
  • min represents the minimum ambient temperature that this device's sensors can report, in degrees Celsius.
  • max represents the maximum ambient temperature that this device's sensors can report, in degrees Celsius.
  • normalizedValue represents the measured ambient temperature, normalized to a 0 to 1 range.

Ambient Atmospheric Pressure

The AmbientAtmosphericPressure Property

This property provides information about the atmospheric pressure around the device.

  • value represents the measured atmospheric pressure around the device, in kiloPascals.
  • min represents the minimum atmospheric pressure that this device's sensors can report, in kiloPascals.
  • max represents the maximum atmospheric pressure that this device's sensors can report, in kiloPascals.
  • normalizedValue represents the measured ambient temperature, normalized to a 0 to 1 range.

Proximity

The Proximity Property

This property provides information about the distance of objects around the device.

  • value represents the measured distance between the device and a nearby object, in meters.
  • min represents the minimum distance that this device's sensors can report, in meters.
  • max represents the maximum distance that this device's sensors can report, in meters.
  • normalizedValue represents the measured distance between the device and a nearby object, normalized to a 0 to 1 range.

Audio and Video Codecs

The properties below expose the device's audio and video codec capabilities.

ECMAScript Example

// 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;
    }
}

The AVCodecs property

This property exposes information about the audio/video codecs available to this system. The information provided when requesting this property is described by the AVCodecsAttributes interface.

attribute AudioCodec audioCodecs[]
The list of audio codecs available on this system.
attribute VideoCodec videoCodecs[]
The list of video codecs available on this system.

The AudioCodec Property

This property exposes information on a single audio codec available on this system. The information provided when requesting this property is described by the AudioCodecAttributes interface.

attribute DOMString compFormats
Space-separated list of MIME types for supported compression formats, e.g. "G.711", "MP3", "MIDI".
attribute boolean encode
true if this device supports audio encoding, false otherwise.
attribute boolean decode
true if this device supports audio decoding, false otherwise.

The VideoCodec Property

This property exposes information on a single video codec available on this system. The information provided when requesting this property is described by the VideoCodecAttributes interface.

attribute DOMString[] compFormats
Space-separated list of MIME types for supported compression formats, e.g. "video/x-webm", "video/ogg"
attribute DOMString[] containerFormats
Supported container format names, e.g. "AVI", "Ogg".
attribute boolean[] hwAccel;
true if the codec includes hardware acceleration support, false otherwise.
attribute DOMString[] profiles
The list of profiles available for this codec. For example, "Simple", "Main", "High" or "Advanced".
attribute DOMString[] frameTypes
The list of frame types supported by the codec. For example, "Progressive" or "Interlaced".
attribute DOMString[] rateTypes
The list of rate control options supported by the codec. For example, "CBR" or "VBR".

Storage Access

This section describe properties that expose a device's storage units, like the unit's type (hard Disk, memory card, etc.) or capacity.

ECMAScript Example

// 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.");
}

The Storage Property

This property exposes the data storage devices connected to this system. When requested through API functions, this property returns an array of objects of type StorageUnitAttributes, corresponding to the storage devices available to this unit.

The StorageUnit Property

This property exposes a single data storage device connected to this system. When requested through API functions, this property returns an object of type StorageUnitAttributes, corresponding to the storage unit specified. This property is enumerable, i.e. an id parameter must be passed to the API function call to indicate which unit is requested.

The StorageUnitAttributes Interface

This interface defines the type of object returned by API functions using the Storage and StorageUnit properties.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this storage unit is unknown.
const unsigned short TYPE_HARDDISK=1
type is set to this value if the device is a hard disk.
const unsigned short TYPE_FLOPPYDISK=2
type is set to this value if the device is a floppy disk.
const unsigned short TYPE_OPTICAL=3
type is set to this value if the device uses optical storage technology, e.g. CD, DVD or Holographic.
const unsigned short TYPE_FLASH=4
type is set to this value if the device uses solid-state RAM technology, e.g. chip or memory card.
attribute unsigned short type
The type of pointing device. The value is one of the constants defined for this attribute.
attribute boolean isWritable
true if this device supports software modification, else otherwise.
attribute unsigned long capacity
The amount of data that this device can hold, in bytes. A monitor() operation acting on an object of type StorageUnit must invoke the success callback only if this attribute has changed.
attribute unsigned long availableCapacity
The amount of available data that this device can hold, in bytes. This attribute can be used as a threshold target.
attribute boolean isRemoveable
true if this unit can be removed from the system (e.g. a memory card unplugged, or a disk ejected), false otherwise.

Output Devices

This section describes system properties related to this device's output devices: screens, sound systems, etc.

ECMAScript Example

// Count the screens

navigator.system.get("OutputDevices", 
                     function(devices) {
                       alert('this device has '+devices.displayDevices.length+' displays);
                     });

The OutputDevices Property

This property provides information on the output devices (displays or audio) available on this system. The information provided when requesting this property is described by the OutputDevicesAttributes interface.

attribute DisplayDeviceAttributes displayDevices[]
The list of display devices connected to this system.
attribute DisplayDeviceAttributes activeDisplayDevices[]
The list of display devices currently in use on this system.
attribute PrintingDeviceAttributes printingDevices[]
The list of printing devices connected to this system.
attribute PrintingDeviceAttributes activePrintingDevice
The printing device currently in use on this system.
attribute BrailleDeviceAttributes brailleDevices[]
The list of Braille terminals connected to this system.
attribute BrailleDeviceAttributes activeBrailleDevice
The Braille terminal currently in use on this system.
attribute AudioDeviceAttributes audioDevices[]
The list of audio devices connected to this system.
attribute AudioDeviceAttributes activeAudioDevices[]
The list of audio devices currently in use on this system.

The DisplayDeviceAttributes interface inherits from the Screen interface defined in [[!CSSOM-VIEW]].

const unsigned short ORIENTATION_UNKNOWN = 0
The device is not able to determine its orientation.
const unsigned short ORIENTATION_LANDSCAPE = 1
The display orientation is landscape.
const unsigned short ORIENTATION_PORTRAIT = 2
The display orientation is portrait.
const unsigned short ORIENTATION_INVERTED_LANDSCAPE = 3
The display orientation is inverted landscape.
const unsigned short ORIENTATION_INVERTED_PORTRAIT = 4
The display orientation is inverted portrait.
attribute unsigned short orientation
The display orientation from the constants listed in this object.
attribute float brightness
The current brightness, from 0 to 1.
attribute float contrast
The current contrast, from 0 to 1.
attribute boolean blanked
true if this display is currently blanked, false otherwise.
attribute unsigned long dotsPerInchW
Resolution of this device, along its width, in dots per inch.
attribute unsigned long dotsPerInchH
Resolution of this device, along its height, in dots per inch.
attribute float physicalWidth
The display's physical width in centimeters.
attribute float physicalHeight
The display's physical height in centimeters.
attribute DOMString? info
Free-form text description of the device.

The AudioDeviceAttributes interface exposes information about an audio output device available to this system.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this audio device is unknown.
const unsigned short TYPE_SPEAKER=1
type is set to this value if this device is a loud speaker.
const unsigned short TYPE_HEADPHONES=2
type is set to this value if this device is a set of headphones.
attribute unsigned short type
The type of audio output device. The value is one of the constants defined for this type.
attribute unsigned long freqRangeLow
Frequency range, low value, in Hz.
attribute unsigned long freqRangeHigh
Frequency range, high value, in Hz.
attribute unsigned short volumeLevel
The volume level of a speaker, on a 0 to 100 scale.
attribute DOMString? info
Free-form text description of the device.

The PrintingDeviceAttributes interface defined below describes any device that prints text or pictures on paper.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this printing device is unknown.
const unsigned short TYPE_INKJET=0
type is set to this value if this printer uses ink jet technology.
const unsigned short TYPE_LASER=1
type is set to this value if this device is a laser printer.
const unsigned short TYPE_EMBOSSED=2
type is set to this value if this device prints by carving or molding the printing surface so that the text or pictures stand out in relief.
const unsigned short TYPE_PLOTTER=3
type is set to this value if this device is a vector graphics printer.
attribute unsigned short type
The type of printer. The value is one of the constants defined for this type.
attribute unsigned long resolution
The printer's resolution, in dots per inch (dpi).
attribute boolean color
true is this printer is able to print in color, false otherwise.
attribute DOMString? info
Free-form text description of the device.

The BrailleDeviceAttributes interface describes a device for displaying Braille characters.

attribute unsigned long nbCells
The number of cells on this device.
attribute DOMString? info
Free-form text description of the device.

Input Devices

This section describes system properties related to this device's input devices: keyboards, microphones, mice, etc.

ECMAScript Example

// Check if the device supports multitouch

navigator.system.get("InputDevices", 
                     function(devices) {
                       for(var i=0; i<pointingDevices.length; i++) {
                         var pointer = pointingDevices[i];
                         if (pointer.type === pointer.TYPE_TOUCHSCREEN && pointer.supportsMultiTouch) {
                           applicationParams.hazMultiTouch = true;
                           break;
                         }
                     });

The InputDevices Property

This property provides information on input devices (cameras, mice) available on this system.

attribute PointerAttributes pointingDevices[]
The list of pointing devices available on this system.
attribute PointerAttributes activePointingDevices[]
The list of pointing devices available on this system that are currently in use.
attribute KeyboardAttributes keyboards[]
The list of keyboards available on this system.
attribute KeyboardAttributes activeKeyboards[]
The list of keyboards available on this system that are currently in use.
attribute CameraAttributes cameras[]
The list of cameras available on this system.
attribute CameraAttributes activeCameras[]
The list of cameras available on this system that are currently in use.
attribute MicrophoneAttributes microphones[]
The list of microphones available on this system.
attribute MicrophoneAttributes activeMicrophones[]
The list of microphones available on this system that are currently in use.

The PointerAttributes interface describes a pointing device attached to the system.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this pointing device is unknown.
const unsigned short TYPE_MOUSE=1
type is set to this value if this device is a mouse.
const unsigned short TYPE_TOUCHSCREEN=2
type is set to this value if this device is a touch screen.
const unsigned short TYPE_LIGHTPEN=3
type is set to this value wen this device is a light pen.
const unsigned short TYPE_GESTURE=4
type is set to this value wen this device is a gesture device.
const unsigned short TYPE_TABLET=5
type is set to this value wen this device is a tablet.
attribute unsigned short type
The type of pointing device. The value is one of the constants defined for this type.
attribute boolean supportsMultiTouch
true if this device supports the multi-touch method of interaction, else otherwise.
attribute DOMString? info
Free-form text description of the device.

The KeyboardAttributes interface describes a keyboard or keypads attached to this system.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this keyboard is unknown.
const unsigned short TYPE_KEYBOARD=1
type is set to this value if this device is a full keyboard.
const unsigned short TYPE_KEYPAD=2
type is set to this value if this device is a keypad.
attribute unsigned short type
The type of pointing device. The value is one of the constants defined for this type.
attribute boolean isHardware
true if this device is a physical keyboard, else if it is a software keyboard.
attribute DOMString? info
Free-form text description of the device.

The CameraAttributes interface property describes a camera or similar video capture device connected to this system.

attribute boolean supportsVideo
true if this device supports recording video, else otherwise.
attribute boolean hasFlash
true if this device supports has a flash, else otherwise.
attribute unsigned long sensorPixels
The number of picture elements (pixels) of this camera.
attribute float? maxZoomFactor
The maximum zoom factor of this camera. This value MUST be null if the camera does not have a zoom (whether physical or digital).
Name of the camera (suitable for use as a ;source=name type parameter in input elements for forms
Space-separated list of available MIME types such as "image/png video/x-webm ..."

The MicrophoneAttributes interface describes a microphone or similar audio capture device attached to the system.

const unsigned short TYPE_UNKNOWN=0
type is set to this value if the type of this microphone is unknown to this API.
const unsigned short TYPE_MICROPHONE=1
type is set to this value if this device is a microphone.
const unsigned short TYPE_LINEIN=2
type is set to this value if this device is a line-in connector.
attribute unsigned short type
The type of audio input device. The value is one of the constants defined for this type.
attribute unsigned long freqRangeLow
Frequency range, low value, in Hz.
attribute unsigned long freqRangeHigh
Frequency range, high value, in Hz.
attribute DOMString? info
Free-form text description of the device.
attribute DOMString? name
Name of the microphone, such as "microphone", "camcorder", "webcam", or "line-in" (suitable for use as a ;source=name type parameter in input elements for forms, e.g., input type=file accept="audio/x-speex;quality=7;bitrate=16000;source=webcam"
attribute DOMString[] types
Space-separated list of available MIME types such as "audio/x-speex audio/ogg"

Extensibility

This 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.

Mapping to the W3C Delivery Context Ontology

The table below lists each interface or attribute described in this specification, as well as the corresponding classes or properties from [[DCONTOLOGY]], if it exists.

System InformationDelivery Context OntologyNotes
Power
PowerAttributes.levelhard:batteryLevel
PowerAttributes.timeRemaining
PowerAttributes.isExternal
PowerAttributes.batteryBeingChargedhard:batteryBeingCharged
CPU
CPUAttributes.usage
Thermal
ThermalAttributes.state
Network
NetworkAttributes.activeConnections
ConnectionAttributes.currentDownloadBandwidth
ConnectionAttributes.currentUploadBandwidth
ConnectionAttributes.maxDownloadBandwidth
ConnectionAttributes.maxUploadBandwidth
ConnectionAttributes.minDownloadBandwidth
ConnectionAttributes.minUploadBandwidth
ConnectionAttributes.currentSignalStrength
ConnectionAttributes.roaming
SensorAttributes
SensorAttributes.value
SensorAttributes.min
SensorAttributes.max
SensorAttributes.normalizedValue
Codecs
AVCodecsAtributes.audioCodecs
AVCodecsAttributes.videoCodecs
AudioCodecAttributes.compFormat
AudioCodecAttributes.encode
AudioCodecAttributes.decode
VideoCodecAttributes.compFormats
VideoCodecAttributes.containerFormats
VideoCodecAttributes.hwAccel
VideoCodecAttributes.profiles
VideoCodecAttributes.frameTypes
VideoCodecAttributes.rateTypes
Storage
StorageUnitAttributes.type
StorageUnitAttributes.isWritable
StorageUnitAttributes.capacity
StorageUnitAttributes.availableCapacity
StorageUnitAttributes.isRemoveable
Output Devices
OutputDevicesAttributes.displayDevices
OutputDevicesAttributes.activeDisplayDevices
OutputDevicesAttributes.audioDevices
OutputDevicesAttributes.activeAudioDevices
DisplayAttributes.orientation
DisplayAttributes.brightness
DisplayAttributes.contrast
DisplayAttributes.blanked
DisplayAttributes.dotsPerInchW
DisplayAttributes.dotsPerInchH
DisplayAttributes.physicalWidth
DisplayAttributes.physicalHeight
SpeakerAttributes.type
SpeakerAttributes.freqRangeLow
SpeakerAttributes.freqRangeHigh
SpeakerAttributes.volumeLevelhard:volumeLevel
Input Devices
InputDevicesAttributes.pointingDevices
InputDevicesAttributes.activePointingDevices
InputDevicesAttributes.keyboards
InputDevicesAttributes.activeKeyboards
InputDevicesAttributes.cameras
InputDevicesAttributes.activeCameras
InputDevicesAttributes.microphones
InputDevicesAttributes.activeMicrophones
PointingDeviceAttributes.type
PointingDeviceAttributes.supportsMultiTouch[[DCONTOLOGY]] has hard:tactileDisplay but only covers touchScreen, mice and styluses are normative instances of hard:inputDevice
KeyboardAttributes.type
KeyboardisHardware
CameraAttributes.supportsVideo
CameraAttributes.sensorPixels
CameraAttributes.hasFlash
CameraAttributes.maxZoomFactors
MicrophoneAttributes.type
MicrophoneAttributes.freqRangeLow
MicrophoneAttributes.freqRangeHigh

Properties And Attributes Table

The table below lists all the properties, the corresponding interface and that interface's attributes

PropertyProperty InterfaceAttributes
PowerPowerAttributeslevel
timeRemaining
isBattery
isCharging
CPUCPUAttributesusage
ThermalThermalAttributesstate
NetworkNetworkAttributesactiveConnections
ConnectionConnectionAttributestype
currentDownloadBandwidth
currentUploadBandwidth
maxDownloadBandwidth
maxUploadBandwidth
currentSignalStrength
roaming
AmbientLight
AmbientNoise
AmbientTemperature
AmbientAtmosphericPressure
Proximity
SensorAttributesvalue
min
max
normalizedValue
AVCodecsAVCodecsAttributesaudioCodecs
videoCodecs
AudioCodecAudioCodecAttributescompFormat
encode
decode
VideoCodecVideoCodecAttributescompFormats
containerFormats
hwAccel
profiles
frameTypes
rateTypes
StorageStorageUnitAttributes (array)
StorageUnitStorageUnitAttributestype
isWritable
capacity
availableCapacity
isRemoveable
OutputDevicesOutputDevicesAttributesdisplayDevices
activeDisplayDevices
printingDevices
activePrintingDevices
brailleDevices
activeBrailleDevices
audioDevices
activeAudioDevices
DisplayDeviceAttributesorientation
brightness
contrast
blanked
dotsPerInchW
dotsPerInchH
physicalWidth
physicalHeight
info
AudioDeviceAttributestype
freqRangeLow
freqRangeHigh
volumeLevel
info
PrintingDeviceAttributestype
resolution
color
info
BrailleDeviceAttributesnbCells
info
InputDevicesInputDevicesAttributespointingDevices
activePointingDevices
keyboards
activeKeyboards
cameras
activeCameras
microphones
activeMicrophones
PointerAttributestype
supportsMultiTouch
info
KeyboardAttributestype
isHardware
info
CameraAttributessupportsVideo
hasFlash
sensorPixels
maxZoomFactor
MicrophoneAttributestype
freqRangeLow
freqRangeHigh
info

Acknowledgements

The DAP 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.