chrome.networking.onc
Description: |
The 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 | |
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" ,
"Tether" ,
"VPN" ,
"Wireless" ,
or "WiFi"
|
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 |
boolean | (optional) SharedSetting |
The value set for all users of the device. Only provided if |DeviceEditiable| is |
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 |
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 |
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 |
integer | (optional) SharedSetting |
The value set for all users of the device. Only provided if |DeviceEditiable| is |
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 |
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 |
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 |
string | (optional) SharedSetting |
The value set for all users of the device. Only provided if |DeviceEditiable| is |
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 |
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 |
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 |
array of string | (optional) SharedSetting |
The value set for all users of the device. Only provided if |DeviceEditiable| is |
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 |
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 |
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 |
IPConfigType | (optional) SharedSetting |
The value set for all users of the device. Only provided if |DeviceEditiable| is |
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 |
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 |
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 |
|
||||||||||||
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 |
array of string | (optional) ExcludedRoutes |
Since Chrome 76. Array of IP blocks in CIDR notation, see onc_spec.md for details. |
array of string | (optional) IncludedRoutes |
Since Chrome 76. Array of IP blocks in CIDR notation, see onc_spec.md for details. |
array of string | (optional) NameServers |
Array of addresses used for name servers. |
array of string | (optional) SearchDomains |
Since Chrome 76. Array of strings for name resolution, see onc_spec.md for details. |
integer | (optional) RoutingPrefix |
The routing prefix. |
string | (optional) Type |
The IP configuration type. Can be |
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 |
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 |
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 |
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 | |
string | (optional) 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) Family |
Cellular device technology family - |
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. |
string | (optional) RoamingState |
The roaming state of the cellular modem on the current network. |
boolean | (optional) Scanning |
Since Chrome 63. True when a cellular network scan is in progress. |
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. |
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 |
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. This cannot be an enum because of 'L2TP-IPSec'. This is optional for NetworkConfigProperties which is passed to setProperties which may be used to set only specific properties. |
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 |
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. |
string | (optional) Passphrase |
Since Chrome 66. The passphrase for WEP/WPA/WPA2 connections. This property can only be set - properties returned by getProperties will not contain this value. |
integer | (optional) RoamThreshold |
Deprecated, ignored. |
string | (optional) SSID |
The network SSID. |
string | (optional) Security |
The network security type. |
integer | (optional) SignalStrength |
The network signal strength. |
string | (optional) TetheringState |
Since Chrome 70. The tethering state associated with the connection. |
NetworkConfigProperties
properties | ||||||||
---|---|---|---|---|---|---|---|---|
CellularProperties | (optional) Cellular | |||||||
EthernetProperties | (optional) Ethernet | |||||||
string | (optional) GUID | |||||||
IPConfigType | (optional) IPAddressConfigType | |||||||
string | (optional) Name | |||||||
IPConfigType | (optional) NameServersConfigType | |||||||
integer | (optional) Priority | |||||||
NetworkType | (optional) Type | |||||||
VPNProperties | (optional) VPN | |||||||
WiFiProperties | (optional) WiFi | |||||||
object | (optional) WiMAX |
Deprecated.
|
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. |
boolean | (optional) Metered |
Since Chrome 85. Warning: this is the current Beta channel. Learn more. Whether the network is metered. |
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. Possible values are:
|
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. |
ManagedProperties
properties | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | (optional) Cellular |
See NetworkProperties.Cellular.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean | (optional) Connectable | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ConnectionStateType | (optional) ConnectionState | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | (optional) ErrorState | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object | (optional) Ethernet |
See NetworkProperties.Ethernet.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | GUID | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ManagedIPConfigType | (optional) IPAddressConfigType | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
array of IPConfigProperties | (optional) IPConfigs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | (optional) MacAddress | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ManagedBoolean | (optional) Metered |
Since Chrome 85. Warning: this is the current Beta channel. Learn more. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ManagedDOMString | (optional) Name | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ManagedIPConfigType | (optional) NameServersConfigType | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ManagedLong | (optional) Priority | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object | (optional) ProxySettings |
See NetworkProperties.ProxySettings.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean | (optional) RestrictedConnectivity | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object | (optional) StaticIPConfig |
See NetworkProperties.StaticIPConfig.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IPConfigProperties | (optional) SavedIPConfig | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | (optional) Source | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NetworkType | Type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object | (optional) VPN |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object | (optional) WiFi |
|
NetworkStateProperties
properties | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | (optional) Cellular |
See NetworkProperties.Cellular.
|
|||||||||||||||||||||
boolean | (optional) Connectable | ||||||||||||||||||||||
ConnectionStateType | (optional) ConnectionState | ||||||||||||||||||||||
object | (optional) Ethernet |
See NetworkProperties.Ethernet.
|
|||||||||||||||||||||
string | (optional) ErrorState | ||||||||||||||||||||||
string | GUID | ||||||||||||||||||||||
string | (optional) Name | ||||||||||||||||||||||
integer | (optional) Priority | ||||||||||||||||||||||
string | (optional) Source | ||||||||||||||||||||||
NetworkType | Type | ||||||||||||||||||||||
object | (optional) VPN |
|
|||||||||||||||||||||
object | (optional) WiFi |
|
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) {...};
|
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) {...};
|
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) {...};
|
setProperties
chrome.networking.onc.setProperties(string networkGuid, NetworkConfigProperties properties, function callback)
Sets the properties of the network with id |networkGuid|. This is only valid for configured networks (Source != None). Unconfigured visible networks should use createNetwork instead. 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 This option is exposed only to Chrome's Web UI. When called by apps, |
|||
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) {...};
|
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.
|
||||||||||||
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) {...};
|
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) {...};
|
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. 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 the connect request immediately failed (e.g. the network is unconfigured), runtime.lastError will be set with a failure reason. 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) {...};
|
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) {...};
|
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) {...};
|
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) {...};
|
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) {...};
|