chrome.networking.onc

Description:

The chrome.networking.onc API is used for configuring network connections (Cellular, Ethernet, VPN, WiFi or WiMAX). This API is available in Chrome OS kiosk sessions.

Network connection configurations are specified following Open Network Configuration (ONC) specification.

NOTE: Most dictionary properties and enum values use UpperCamelCase to match the ONC specification instead of the JavaScript lowerCamelCase convention.


Availability: Since Chrome 59.
Permissions: "networking.onc"

Summary

Types
ActivationStateType
CaptivePortalStatus
ConnectionStateType
IPConfigType
NetworkType
ProxySettingsType
ManagedBoolean
ManagedLong
ManagedDOMString
ManagedDOMStringList
ManagedIPConfigType
CellularProviderProperties
IssuerSubjectPattern
EAPProperties
FoundNetworkProperties
IPConfigProperties
PaymentPortal
ProxyLocation
ManagedProxyLocation
ManualProxySettings
ProxySettings
SIMLockStatus
ThirdPartyVPNProperties
ManagedThirdPartyVPNProperties
CellularProperties
EthernetProperties
VPNProperties
WiFiProperties
WiMAXProperties
NetworkConfigProperties
NetworkProperties
ManagedProperties
NetworkStateProperties
Methods
getProperties chrome.networking.onc.getProperties(string networkGuid, function callback)
getManagedProperties chrome.networking.onc.getManagedProperties(string networkGuid, function callback)
getState chrome.networking.onc.getState(string networkGuid, function callback)
setProperties chrome.networking.onc.setProperties(string networkGuid, NetworkConfigProperties properties, function callback)
createNetwork chrome.networking.onc.createNetwork(boolean shared, NetworkConfigProperties properties, function callback)
forgetNetwork chrome.networking.onc.forgetNetwork(string networkGuid, function callback)
getNetworks chrome.networking.onc.getNetworks(object filter, function callback)
getDeviceStates chrome.networking.onc.getDeviceStates(function callback)
enableNetworkType chrome.networking.onc.enableNetworkType( NetworkType networkType)
disableNetworkType chrome.networking.onc.disableNetworkType( NetworkType networkType)
requestNetworkScan chrome.networking.onc.requestNetworkScan( NetworkType networkType)
startConnect chrome.networking.onc.startConnect(string networkGuid, function callback)
startDisconnect chrome.networking.onc.startDisconnect(string networkGuid, function callback)
getCaptivePortalStatus chrome.networking.onc.getCaptivePortalStatus(string networkGuid, function callback)
getGlobalPolicy chrome.networking.onc.getGlobalPolicy(function callback)
Events
onNetworksChanged
onNetworkListChanged
onDeviceStateListChanged
onPortalDetectionCompleted

Types

ActivationStateType

Enum
"Activated", "Activating", "NotActivated", or "PartiallyActivated"

CaptivePortalStatus

Enum
"Unknown", "Offline", "Online", "Portal", or "ProxyAuthRequired"

ConnectionStateType

Enum
"Connected", "Connecting", or "NotConnected"

IPConfigType

Enum
"DHCP", or "Static"

NetworkType

Enum
"All", "Cellular", "Ethernet", "VPN", "Wireless", "WiFi", or "WiMAX"

ProxySettingsType

Enum
"Direct", "Manual", "PAC", or "WPAD"

ManagedBoolean

properties
boolean (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

boolean (optional) UserPolicy

The property value provided by the user policy.

boolean (optional) DevicePolicy

The property value provided by the device policy.

boolean (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

boolean (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

ManagedLong

properties
integer (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

integer (optional) UserPolicy

The property value provided by the user policy.

integer (optional) DevicePolicy

The property value provided by the device policy.

integer (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

integer (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

ManagedDOMString

properties
string (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

string (optional) UserPolicy

The property value provided by the user policy.

string (optional) DevicePolicy

The property value provided by the device policy.

string (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

string (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

ManagedDOMStringList

properties
array of string (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

array of string (optional) UserPolicy

The property value provided by the user policy.

array of string (optional) DevicePolicy

The property value provided by the device policy.

array of string (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

array of string (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

ManagedIPConfigType

properties
IPConfigType (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

IPConfigType (optional) UserPolicy

The property value provided by the user policy.

IPConfigType (optional) DevicePolicy

The property value provided by the device policy.

IPConfigType (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

IPConfigType (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

CellularProviderProperties

properties
string Name

The operator name.

string Code

Cellular network ID as a simple concatenation of the network's MCC (Mobile Country Code) and MNC (Mobile Network Code).

string (optional) Country

The two-letter country code.

IssuerSubjectPattern

properties
string (optional) CommonName

If set, the value against which to match the certificate subject's common name.

string (optional) Locality

If set, the value against which to match the certificate subject's common location.

string (optional) Organization

If set, the value against which to match the certificate subject's organizations. At least one organization should match the value.

string (optional) OrganizationalUnit

If set, the value against which to match the certificate subject's organizational units. At least one organizational unit should match the value.

EAPProperties

properties
string (optional) AnonymousIdentity
object (optional) ClientCertPattern
array of string (optional) EnrollmentURI

List of URIs to which the user can be directed in case no certificates that match this pattern are found.

IssuerSubjectPattern (optional) Issuer

If set, pattern against which X.509 issuer settings should be matched.

array of string (optional) IssuerCARef

List of certificate issuer CA certificates. A certificate must be signed by one of them in order to match this pattern.

IssuerSubjectPattern (optional) Subject

If set, pattern against which X.509 subject settings should be matched.

string (optional) ClientCertPKCS11Id

Since Chrome 60.

string (optional) ClientCertRef
enum of "Ref", or "Pattern" ClientCertType
string (optional) Identity
string (optional) Inner
string (optional) Outer

The outer EAP type. Required by ONC, but may not be provided when translating from Shill.

string (optional) Password
boolean (optional) SaveCredentials
array of string (optional) ServerCAPEMs
array of string (optional) ServerCARefs
ManagedDOMString (optional) SubjectMatch

Since Chrome 60.

boolean (optional) UseProactiveKeyCaching
boolean (optional) UseSystemCAs

FoundNetworkProperties

properties
string Status

Network availability.

string NetworkId

Network ID.

string Technology

Access technology used by the network.

string (optional) ShortName

The network operator's short-format name.

string (optional) LongName

The network operator's long-format name.

IPConfigProperties

properties
string (optional) Gateway

Gateway address used for the IP configuration.

string (optional) IPAddress

The IP address for a connection. Can be IPv4 or IPv6 address, depending on value of Type.

array of string (optional) NameServers

Array of addresses used for name servers.

integer (optional) RoutingPrefix

The routing prefix.

string (optional) Type

The IP configuration type. Can be IPv4 or IPv6.

string (optional) WebProxyAutoDiscoveryUrl

The URL for WEb Proxy Auto-Discovery, as reported over DHCP.

PaymentPortal

properties
string Method

The HTTP method to use for the payment portal.

string (optional) PostData

The post data to send to the payment portal. Ignored unless Method is POST.

string (optional) Url

The payment portal URL.

ProxyLocation

properties
string Host

The proxy IP address host.

integer Port

The port to use for the proxy.

ManagedProxyLocation

properties
ManagedDOMString Host

See ProxyLocation.Host.

ManagedLong Port

See ProxyLocation.Port.

ManualProxySettings

properties
ProxyLocation (optional) HTTPProxy

Settings for HTTP proxy.

ProxyLocation (optional) SecureHTTPProxy

Settings for secure HTTP proxy.

ProxyLocation (optional) FTPProxy

Settings for FTP proxy.

ProxyLocation (optional) SOCKS

Settings for SOCKS proxy.

ProxySettings

properties
ProxySettingsType Type

The type of proxy settings.

ManualProxySettings (optional) Manual

Manual proxy settings - used only for Manual proxy settings.

array of string (optional) ExcludeDomains

Domains and hosts for which manual proxy settings are excluded.

string (optional) PAC

URL for proxy auto-configuration file.

SIMLockStatus

properties
string LockType

The status of SIM lock - possible values are 'sim-pin', 'sim-puk' and ''.

boolean LockEnabled

Whether SIM lock is enabled.

integer (optional) RetriesLeft

Number of PIN lock tries allowed before PUK is required to unlock the SIM.

ThirdPartyVPNProperties

properties
string ExtensionID

ID of the third-party VPN provider extension.

string (optional) ProviderName

The VPN provider name.

ManagedThirdPartyVPNProperties

properties
ManagedDOMString ExtensionID

See ThirdPartyVPNProperties.ExtensionID.

string (optional) ProviderName

See ThirdPartyVPNProperties.ProviderName.

CellularProperties

properties
boolean (optional) AutoConnect

Whether the cellular network should be connected automatically (when in range).

string (optional) ActivationType

The cellular network activation type.

ActivationStateType (optional) ActivationState

Carrier account activation state.

boolean (optional) AllowRoaming

Whether roaming is allowed for the network.

string (optional) Carrier

The name of the carrier for which the cellular device is configured.

string (optional) Family

Cellular device technology family - CDMA or GSM.

string (optional) FirmwareRevision

The firmware revision loaded in the cellular modem.

array of FoundNetworkProperties (optional) FoundNetworks

The list of networks found during the most recent network scan.

string (optional) HardwareRevision

The cellular modem hardware revision.

CellularProviderProperties (optional) HomeProvider

Information about the operator that issued the SIM card currently installed in the modem.

string (optional) Manufacturer

The cellular modem manufacturer.

string (optional) ModelID

The cellular modem model ID.

string (optional) NetworkTechnology

If the modem is registered on a network, the network technology currently in use.

PaymentPortal (optional) PaymentPortal

Online payment portal a user can use to sign-up for or modify a mobile data plan.

integer (optional) PRLVersion

The revision of the Preferred Roaming List loaded in the modem.

string (optional) RoamingState

The roaming state of the cellular modem on the current network.

CellularProviderProperties (optional) ServingOperator

Information about the operator on whose network the modem is currently registered.

SIMLockStatus (optional) SIMLockStatus

The state of SIM lock for GSM family networks.

boolean (optional) SIMPresent

Whether a SIM card is present.

integer (optional) SignalStrength

The current network signal strength.

boolean (optional) SupportNetworkScan

Whether the cellular network supports scanning.

array of string (optional) SupportedCarriers

A list of supported carriers.

EthernetProperties

properties
boolean (optional) AutoConnect

Whether the Ethernet network should be connected automatically.

string (optional) Authentication

The authentication used by the Ethernet network. Possible values are None and 8021X.

EAPProperties (optional) EAP

Network's EAP settings. Required for 8021X authentication.

VPNProperties

properties
boolean (optional) AutoConnect

Whether the VPN network should be connected automatically.

string (optional) Host

The VPN host.

string (optional) Type

The VPN type.

WiFiProperties

properties
boolean (optional) AllowGatewayARPPolling

Whether ARP polling of default gateway is allowed. Defaults to true.

boolean (optional) AutoConnect

Whether the WiFi network should be connected automatically when in range.

string (optional) BSSID

The BSSID of the associated access point..

EAPProperties (optional) EAP

The network EAP properties. Required for WEP-8021X and WPA-EAP networks.

integer (optional) Frequency

The WiFi service operating frequency in MHz. For connected networks, the current frequency on which the network is connected. Otherwise, the frequency of the best available BSS.

array of integer (optional) FrequencyList

Contains all operating frequency recently seen for the WiFi network.

string (optional) HexSSID

HEX-encoded copy of the network SSID.

boolean (optional) HiddenSSID

Whether the network SSID will be broadcast.

integer (optional) RoamThreshold

Signal-to-noise value (in dB) below which roaming to a new network should be attempted.

string (optional) SSID

The network SSID.

string (optional) Security

The network security type.

integer (optional) SignalStrength

The network signal strength.

WiMAXProperties

properties
boolean (optional) AutoConnect

Whether the network should be connected automatically.

EAPProperties (optional) EAP

The network EAP properties.

integer (optional) SignalStrength

The network signal strength.

NetworkConfigProperties

properties
CellularProperties (optional) Cellular

See NetworkProperties.Cellular.

EthernetProperties (optional) Ethernet

See NetworkProperties.Ethernet.

string (optional) GUID

See NetworkProperties.GUID.

IPConfigType (optional) IPAddressConfigType

See NetworkProperties.IPAddressConfigType.

string (optional) Name

See NetworkProperties.Name.

IPConfigType (optional) NameServersConfigType

See NetworkProperties.NameServersConfigType.

integer (optional) Priority

See NetworkProperties.Priority.

NetworkType (optional) Type

See NetworkProperties.Type.

VPNProperties (optional) VPN

See NetworkProperties.VPN.

WiFiProperties (optional) WiFi

See NetworkProperties.WiFi.

WiMAXProperties (optional) WiMAX

See NetworkProperties.WiMAX.

NetworkProperties

properties
CellularProperties (optional) Cellular

For cellular networks, cellular network properties.

boolean (optional) Connectable

Whether the network is connectable.

ConnectionStateType (optional) ConnectionState

The network's current connection state.

string (optional) ErrorState

The last recorded network error state.

EthernetProperties (optional) Ethernet

For Ethernet networks, the Ethernet network properties.

string GUID

The network GUID.

IPConfigType (optional) IPAddressConfigType

The network's IP address configuration type.

array of IPConfigProperties (optional) IPConfigs

The network's IP configuration.

string (optional) MacAddress

The network's MAC address.

string (optional) Name

A user friendly network name.

IPConfigType (optional) NameServersConfigType

The IP configuration type for the name servers used by the network.

integer (optional) Priority

The network priority.

ProxySettings (optional) ProxySettings

The network's proxy settings.

boolean (optional) RestrictedConnectivity

For a connected network, whether the network connectivity to the Internet is limited, e.g. if the network is behind a portal, or a cellular network is not activated.

IPConfigProperties (optional) StaticIPConfig

The network's static IP configuration.

IPConfigProperties (optional) SavedIPConfig

IP configuration that was received from the DHCP server before applying static IP configuration.

string (optional) Source

Indicates whether and how the network is configured.

NetworkType Type

The network type.

VPNProperties (optional) VPN

For VPN networks, the network VPN properties.

WiFiProperties (optional) WiFi

For WiFi networks, the network WiFi properties.

WiMAXProperties (optional) WiMAX

For WiMAX networks, the network WiMAX properties.

ManagedProperties

properties
object (optional) Cellular

See NetworkProperties.Cellular.

ManagedBoolean (optional) AutoConnect

See CellularProperties.AutoConnect.

string (optional) ActivationType

See CellularProperties.ActivationType.

ActivationStateType (optional) ActivationState

See CellularProperties.ActivationState.

boolean (optional) AllowRoaming

See CellularProperties.AllowRoaming.

ManagedDOMString (optional) Carrier

See CellularProperties.Carrier.

string (optional) Family

See CellularProperties.Family.

string (optional) FirmwareRevision

See CellularProperties.FirmwareRevision.

array of FoundNetworkProperties (optional) FoundNetworks

See CellularProperties.FoundNetworks.

string (optional) HardwareRevision

See CellularProperties.HardwareRevision.

array of CellularProviderProperties (optional) HomeProvider

See CellularProperties.HomeProvider.

string (optional) Manufacturer

See CellularProperties.Manufacturer.

string (optional) ModelID

See CellularProperties.ModelID.

string (optional) NetworkTechnology

See CellularProperties.NetworkTechnology.

PaymentPortal (optional) PaymentPortal

See CellularProperties.PaymentPortal.

integer (optional) PRLVersion

See CellularProperties.PRLVersion.

string (optional) RoamingState

See CellularProperties.RoamingState.

CellularProviderProperties (optional) ServingOperator

See CellularProperties.ServingOperator.

SIMLockStatus (optional) SIMLockStatus

See CellularProperties.SIMLockStatus.

boolean (optional) SIMPresent

See CellularProperties.SIMPresent.

integer (optional) SignalStrength

See CellularProperties.SignalStrength.

boolean (optional) SupportNetworkScan

See CellularProperties.SupportNetworkScan.

array of string (optional) SupportedCarriers

See CellularProperties.SupportedCarriers.

boolean (optional) Connectable

See NetworkProperties.Connectable.

ConnectionStateType (optional) ConnectionState

See NetworkProperties.ConnectionState.

string (optional) ErrorState

See NetworkProperties.ErrorState.

object (optional) Ethernet

See NetworkProperties.Ethernet.

ManagedBoolean (optional) AutoConnect

See EthernetProperties.AutoConnect.

ManagedDOMString (optional) Authentication

See EthernetProperties.Authentication.

string GUID

See NetworkProperties.GUID.

ManagedIPConfigType (optional) IPAddressConfigType

See NetworkProperties.IPAddressConfigType.

array of IPConfigProperties (optional) IPConfigs

See NetworkProperties.IPConfigs.

string (optional) MacAddress

See NetworkProperties.MacAddress.

ManagedDOMString (optional) Name

See NetworkProperties.Name.

ManagedIPConfigType (optional) NameServersConfigType

See NetworkProperties.NameServersConfigType.

ManagedLong (optional) Priority

See NetworkProperties.Priority.

object (optional) ProxySettings

See NetworkProperties.ProxySettings.

object Type

See ProxySettings.Type.

ProxySettingsType (optional) Active

The active value currently used by the network configuration manager (e.g. Shill).

string (optional) Effective

The source from which the effective property value was determined.

ProxySettingsType (optional) UserPolicy

The property value provided by the user policy.

ProxySettingsType (optional) DevicePolicy

The property value provided by the device policy.

ProxySettingsType (optional) UserSetting

The property value set by the logged in user. Only provided if |UserEditable| is true.

ProxySettingsType (optional) SharedSetting

The value set for all users of the device. Only provided if |DeviceEditiable| is true.

boolean (optional) UserEditable

Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

boolean (optional) DeviceEditable

Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false.

object (optional) Manual

See ProxySettings.Manual.

ManagedProxyLocation (optional) HTTPProxy

See ManualProxySettings.HTTPProxy.

ManagedProxyLocation (optional) SecureHTTPProxy

See ManualProxySettings.SecureHTTPProxy.

ManagedProxyLocation (optional) FTPProxy

See ManualProxySettings.FTPProxy.

ManagedProxyLocation (optional) SOCKS

See ManualProxySettings.SOCKS.

ManagedDOMStringList (optional) ExcludeDomains

See ProxySettings.ExcludeDomains.

ManagedDOMString (optional) PAC

See ProxySettings.PAC.

boolean (optional) RestrictedConnectivity

See NetworkProperties.RestrictedConnectivity.

object (optional) StaticIPConfig

See NetworkProperties.StaticIPConfig.

ManagedDOMString (optional) Gateway

See IPConfigProperties.Gateway.

ManagedDOMString (optional) IPAddress

See IPConfigProperties.IPAddress.

ManagedDOMStringList (optional) NameServers

See IPConfigProperties.NameServers.

ManagedLong (optional) RoutingPrefix

See IPConfigProperties.RoutingPrefix.

ManagedDOMString (optional) Type

See IPConfigProperties.Type.

ManagedDOMString (optional) WebProxyAutoDiscoveryUrl

See IPConfigProperties.WebProxyAutoDiscoveryUrl.

IPConfigProperties (optional) SavedIPConfig

See NetworkProperties.SavedIPConfig.

string (optional) Source

See NetworkProperties.Source.

NetworkType Type

See NetworkProperties.Type.

object (optional) VPN

See NetworkProperties.VPN.

ManagedBoolean (optional) AutoConnect

See VPNProperties.AutoConnect.

ManagedDOMString (optional) Host

See VPNProperties.Host.

ManagedDOMString Type

See VPNProperties.Type.

object (optional) WiFi

See NetworkProperties.WiFi.

ManagedBoolean (optional) AllowGatewayARPPolling

See WiFiProperties.AllowGatewayARPPolling.

ManagedBoolean (optional) AutoConnect

See WiFiProperties.AutoConnect.

string (optional) BSSID

See WiFiProperties.BSSID.

integer (optional) Frequency

See WiFiProperties.Frequency.

array of integer (optional) FrequencyList

See WiFiProperties.FrequencyList.

ManagedDOMString (optional) HexSSID

See WiFiProperties.HexSSID.

ManagedBoolean (optional) HiddenSSID

See WiFiProperties.HiddenSSID.

ManagedLong (optional) RoamThreshold

See WiFiProperties.RoamThreshold.

ManagedDOMString (optional) SSID

See WiFiProperties.SSID.

ManagedDOMString Security

See WiFiProperties.Security.

integer (optional) SignalStrength

See WiFiProperties.SignalStrength.

object (optional) WiMAX

See NetworkProperties.WiMAX.

ManagedBoolean (optional) AutoConnect

See WiMAXProperties.AutoConnect.

integer (optional) SignalStrength

See WiMAXProperties.SignalStrength.

NetworkStateProperties

properties
object (optional) Cellular

See NetworkProperties.Cellular.

ActivationStateType (optional) ActivationState

See CellularProperties.ActivationState.

string (optional) NetworkTechnology

See CellularProperties.NetworkTechnology.

string (optional) RoamingState

See CellularProperties.RoamingState.

boolean (optional) SIMPresent

See CellularProperties.SIMPresent.

integer (optional) SignalStrength

See CellularProperties.SignalStrength.

boolean (optional) Connectable

See NetworkProperties.Connectable.

ConnectionStateType (optional) ConnectionState

See NetworkProperties.ConnectionState.

object (optional) Ethernet

See NetworkProperties.Ethernet.

string Authentication

See EthernetProperties.Authentication.

string (optional) ErrorState

See NetworkProperties.ErrorState.

string GUID

See NetworkProperties.GUID.

string (optional) Name

See NetworkProperties.Name.

integer (optional) Priority

See NetworkProperties.Priority.

string (optional) Source

See NetworkProperties.Source.

NetworkType Type

See NetworkProperties.Type.

object (optional) VPN

See NetworkProperties.VPN.

string Type

See VPNProperties.Type.

object (optional) WiFi

See NetworkProperties.WiFi.

string (optional) BSSID

See WiFiProperties.BSSID.

integer (optional) Frequency

See WiFiProperties.Frequency.

string (optional) HexSSID

Since Chrome 63. Warning: this is the current Dev channel. Learn more.

See WiFiProperties.HexSSID.

string Security

See WiFiProperties.Security.

integer (optional) SignalStrength

See WiFiProperties.SignalStrength.

string (optional) SSID

Since Chrome 63. Warning: this is the current Dev channel. Learn more.

See WiFiProperties.SSID.

object (optional) WiMAX

See NetworkProperties.WiMAX.

integer (optional) SignalStrength

See WiMAXProperties.SignalStrength.

Methods

getProperties

chrome.networking.onc.getProperties(string networkGuid, function callback)

Gets all the properties of the network with id networkGuid. Includes all properties of the network (read-only and read/write values).

Parameters
string networkGuid

The GUID of the network to get properties for.

function callback

Called with the network properties when received.

The callback parameter should be a function that looks like this:

function( NetworkProperties result) {...};
NetworkProperties result

getManagedProperties

chrome.networking.onc.getManagedProperties(string networkGuid, function callback)

Gets the merged properties of the network with id networkGuid from the sources: User settings, shared settings, user policy, device policy and the currently active settings.

Parameters
string networkGuid

The GUID of the network to get properties for.

function callback

Called with the managed network properties when received.

The callback parameter should be a function that looks like this:

function( ManagedProperties result) {...};
ManagedProperties result

getState

chrome.networking.onc.getState(string networkGuid, function callback)

Gets the cached read-only properties of the network with id networkGuid. This is meant to be a higher performance function than getProperties, which requires a round trip to query the networking subsystem. The following properties are returned for all networks: GUID, Type, Name, WiFi.Security. Additional properties are provided for visible networks: ConnectionState, ErrorState, WiFi.SignalStrength, Cellular.NetworkTechnology, Cellular.ActivationState, Cellular.RoamingState.

Parameters
string networkGuid

The GUID of the network to get properties for.

function callback

Called immediately with the network state properties.

The callback parameter should be a function that looks like this:

function( NetworkStateProperties result) {...};
NetworkStateProperties result

setProperties

chrome.networking.onc.setProperties(string networkGuid, NetworkConfigProperties properties, function callback)

Sets the properties of the network with id networkGuid. In kiosk sessions, calling this method on a shared network will fail.

Parameters
string networkGuid

The GUID of the network to set properties for.

NetworkConfigProperties properties

The properties to set.

function (optional) callback

Called when the operation has completed.

If you specify the callback parameter, it should be a function that looks like this:

function() {...};

createNetwork

chrome.networking.onc.createNetwork(boolean shared, NetworkConfigProperties properties, function callback)

Creates a new network configuration from properties. If a matching configured network already exists, this will fail. Otherwise returns the GUID of the new network.

Parameters
boolean shared

If true, share this network configuration with other users.

This option is exposed only to Chrome's Web UI. When called by apps, false is the only allowed value.

NetworkConfigProperties properties

The properties to configure the new network with.

function (optional) callback

Called with the GUID for the new network configuration once the network has been created.

If you specify the callback parameter, it should be a function that looks like this:

function(string result) {...};
string result

forgetNetwork

chrome.networking.onc.forgetNetwork(string networkGuid, function callback)

Forgets a network configuration by clearing any configured properties for the network with GUID networkGuid. This may also include any other networks with matching identifiers (e.g. WiFi SSID and Security). If no such configuration exists, an error will be set and the operation will fail.

In kiosk sessions, this method will not be able to forget shared network configurations.

Parameters
string networkGuid

The GUID of the network to forget.

function (optional) callback

Called when the operation has completed.

If you specify the callback parameter, it should be a function that looks like this:

function() {...};

getNetworks

chrome.networking.onc.getNetworks(object filter, function callback)

Returns a list of network objects with the same properties provided by getState. A filter is provided to specify the type of networks returned and to limit the number of networks. Networks are ordered by the system based on their priority, with connected or connecting networks listed first.

Parameters
object filter

Describes which networks to return.

NetworkType networkType

The type of networks to return.

boolean (optional) visible

If true, only include visible (physically connected or in-range) networks. Defaults to 'false'.

boolean (optional) configured

If true, only include configured (saved) networks. Defaults to 'false'.

integer (optional) limit

Maximum number of networks to return. Defaults to 1000 if unspecified. Use 0 for no limit.

function callback

Called with a dictionary of networks and their state properties when received.

The callback parameter should be a function that looks like this:

function(array of NetworkStateProperties result) {...};
array of NetworkStateProperties result

getDeviceStates

chrome.networking.onc.getDeviceStates(function callback)

Returns states of available networking devices.

Parameters
function callback

Called with a list of devices and their state.

The callback parameter should be a function that looks like this:

function(array of object result) {...};
array of object result

Properties of each object

boolean (optional) Scanning

Set if the device is enabled. True if the device is currently scanning.

SIMLockStatus (optional) SIMLockStatus

The SIM lock status if Type = Cellular and SIMPresent = True.

boolean (optional) SIMPresent

Set to the SIM present state if the device type is Cellular.

enum of "Uninitialized", "Disabled", "Enabling", "Enabled", or "Prohibited" State

The current state of the device.

Uninitialized
Device is available but not initialized.
Disabled
Device is initialized but not enabled.
Enabling
Enabled state has been requested but has not completed.
Enabled
Device is enabled.
Prohibited
Device is prohibited.
NetworkType Type

The network type associated with the device (Cellular, Ethernet, WiFi, or WiMAX).

enableNetworkType

chrome.networking.onc.enableNetworkType( NetworkType networkType)

Enables any devices matching the specified network type. Note, the type might represent multiple network types (e.g. 'Wireless').

Parameters
NetworkType networkType

The type of network to enable.

disableNetworkType

chrome.networking.onc.disableNetworkType( NetworkType networkType)

Disables any devices matching the specified network type. See note for enableNetworkType.

Parameters
NetworkType networkType

The type of network to disable.

requestNetworkScan

chrome.networking.onc.requestNetworkScan( NetworkType networkType)

Requests that the networking subsystem scan for new networks and update the list returned by getVisibleNetworks. This is only a request: the network subsystem can choose to ignore it. If the list is updated, then the onNetworkListChanged event will be fired.

Parameters
NetworkType (optional) networkType

Since Chrome 63. Warning: this is the current Dev channel. Learn more.

If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported.

startConnect

chrome.networking.onc.startConnect(string networkGuid, function callback)

Starts a connection to the network with networkGuid.

Parameters
string networkGuid

The GUID of the network to connect to.

function (optional) callback

Called when the connect request has been sent. Note: the connection may not have completed. Observe onNetworksChanged to be notified when a network state changes.

If you specify the callback parameter, it should be a function that looks like this:

function() {...};

startDisconnect

chrome.networking.onc.startDisconnect(string networkGuid, function callback)

Starts a disconnect from the network with networkGuid.

Parameters
string networkGuid

The GUID of the network to disconnect from.

function (optional) callback

Called when the disconnect request has been sent. See note for startConnect.

If you specify the callback parameter, it should be a function that looks like this:

function() {...};

getCaptivePortalStatus

chrome.networking.onc.getCaptivePortalStatus(string networkGuid, function callback)

Returns captive portal status for the network matching 'networkGuid'.

Parameters
string networkGuid

The GUID of the network to get captive portal status for.

function callback

A callback function that returns the results of the query for network captive portal status.

The callback parameter should be a function that looks like this:

function( CaptivePortalStatus result) {...};
CaptivePortalStatus result

getGlobalPolicy

chrome.networking.onc.getGlobalPolicy(function callback)

Gets the global policy properties. These properties are not expected to change during a session.

Parameters
function callback

The callback parameter should be a function that looks like this:

function(object result) {...};
object result
boolean (optional) AllowOnlyPolicyNetworksToAutoconnect

If true, only policy networks may auto connect. Defaults to false.

boolean (optional) AllowOnlyPolicyNetworksToConnect

If true, only policy networks may be connected to and no new networks may be added or configured. Defaults to false.

Events

onNetworksChanged

Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed.

addListener

chrome.networking.onc.onNetworksChanged.addListener(function callback)
Parameters
function callback

The callback parameter should be a function that looks like this:

function(array of string changes) {...};
array of string changes

onNetworkListChanged

Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks.

addListener

chrome.networking.onc.onNetworkListChanged.addListener(function callback)
Parameters
function callback

The callback parameter should be a function that looks like this:

function(array of string changes) {...};
array of string changes

onDeviceStateListChanged

Fired when the list of devices has changed or any device state properties have changed.

addListener

chrome.networking.onc.onDeviceStateListChanged.addListener(function callback)
Parameters
function callback

The callback parameter should be a function that looks like this:

function() {...};

onPortalDetectionCompleted

Fired when a portal detection for a network completes. Sends the GUID of the network and the corresponding captive portal status.

addListener

chrome.networking.onc.onPortalDetectionCompleted.addListener(function callback)
Parameters
function callback

The callback parameter should be a function that looks like this:

function(string networkGuid, CaptivePortalStatus status) {...};
string networkGuid
CaptivePortalStatus status