chrome.networking.onc
- Description
The
chrome.networking.onc
API is used for configuring network connections (Cellular, Ethernet, VPN or WiFi). This API is available in auto-launched 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.
- Permissions
networking.onc
- AvailabilitySince Chrome 59.
Summary
- Types
- Methods
networking.onc.createNetwork(shared: boolean, properties: NetworkConfigProperties, callback: function)
networking.onc.disableNetworkType(networkType: NetworkType)
networking.onc.enableNetworkType(networkType: NetworkType)
networking.onc.forgetNetwork(networkGuid: string, callback: function)
networking.onc.getCaptivePortalStatus(networkGuid: string, callback: function)
networking.onc.getDeviceStates(callback: function)
networking.onc.getGlobalPolicy(callback: function)
networking.onc.getManagedProperties(networkGuid: string, callback: function)
networking.onc.getNetworks(filter: NetworkFilter, callback: function)
networking.onc.getProperties(networkGuid: string, callback: function)
networking.onc.getState(networkGuid: string, callback: function)
networking.onc.requestNetworkScan(networkType: NetworkType)
networking.onc.setProperties(networkGuid: string, properties: NetworkConfigProperties, callback: function)
networking.onc.startConnect(networkGuid: string, callback: function)
networking.onc.startDisconnect(networkGuid: string, callback: function)
- Events
Types
CellularProperties
Properties
- ActivationStateActivationStateType optional
Carrier account activation state.
- ActivationTypestring optional
The cellular network activation type.
- AllowRoamingboolean optional
Whether roaming is allowed for the network.
- AutoConnectboolean optional
Whether the cellular network should be connected automatically (when in range).
- Familystring optional
Cellular device technology family -
CDMA
orGSM
. - FirmwareRevisionstring optional
The firmware revision loaded in the cellular modem.
- FoundNetworksFoundNetworkProperties[] optional
The list of networks found during the most recent network scan.
- HardwareRevisionstring optional
The cellular modem hardware revision.
- HomeProviderCellularProviderProperties optional
Information about the operator that issued the SIM card currently installed in the modem.
- Manufacturerstring optional
The cellular modem manufacturer.
- ModelIDstring optional
The cellular modem model ID.
- NetworkTechnologystring optional
If the modem is registered on a network, the network technology currently in use.
- PaymentPortalPaymentPortal optional
Online payment portal a user can use to sign-up for or modify a mobile data plan.
- RoamingStatestring optional
The roaming state of the cellular modem on the current network.
- SIMLockStatusSIMLockStatus optional
The state of SIM lock for GSM family networks.
- SIMPresentboolean optional
Whether a SIM card is present.
- Scanningboolean optional
Since Chrome 63.
True when a cellular network scan is in progress.
- ServingOperatorCellularProviderProperties optional
Information about the operator on whose network the modem is currently registered.
- SignalStrengthnumber optional
The current network signal strength.
- SupportNetworkScanboolean optional
Whether the cellular network supports scanning.
CellularProviderProperties
Properties
- Codestring
Cellular network ID as a simple concatenation of the network's MCC (Mobile Country Code) and MNC (Mobile Network Code).
- Countrystring optional
The two-letter country code.
- Namestring
The operator name.
CellularStateProperties
Properties
- ActivationStateActivationStateType optional
- NetworkTechnologystring optional
- RoamingStatestring optional
- SIMPresentboolean optional
- SignalStrengthnumber optional
CertificatePattern
Properties
- EnrollmentURIstring[] optional
List of URIs to which the user can be directed in case no certificates that match this pattern are found.
- IssuerIssuerSubjectPattern optional
If set, pattern against which X.509 issuer settings should be matched.
- IssuerCARefstring[] optional
List of certificate issuer CA certificates. A certificate must be signed by one of them in order to match this pattern.
- SubjectIssuerSubjectPattern optional
If set, pattern against which X.509 subject settings should be matched.
DeviceStateProperties
Properties
- SIMLockStatusSIMLockStatus optional
Since Chrome 62.
The SIM lock status if Type = Cellular and SIMPresent = True.
- SIMPresentboolean optional
Since Chrome 62.
Set to the SIM present state if the device type is Cellular.
- Scanningboolean optional
Set if the device is enabled. True if the device is currently scanning.
- State
The current state of the device.
- Type
The network type associated with the device (Cellular, Ethernet or WiFi).
EAPProperties
Properties
- AnonymousIdentitystring optional
- ClientCertPKCS11Idstring optional
Since Chrome 60.
- ClientCertPatternCertificatePattern optional
- ClientCertRefstring optional
- ClientCertType
- Identitystring optional
- Innerstring optional
- Outerstring optional
The outer EAP type. Required by ONC, but may not be provided when translating from Shill.
- Passwordstring optional
- SaveCredentialsboolean optional
- ServerCAPEMsstring[] optional
- ServerCARefsstring[] optional
- SubjectMatchManagedDOMString optional
Since Chrome 60.
- UseProactiveKeyCachingboolean optional
- UseSystemCAsboolean optional
EthernetProperties
Properties
- Authenticationstring optional
The authentication used by the Ethernet network. Possible values are
None
and8021X
. - AutoConnectboolean optional
Whether the Ethernet network should be connected automatically.
- EAPEAPProperties optional
Network's EAP settings. Required for 8021X authentication.
EthernetStateProperties
Properties
- Authenticationstring
FoundNetworkProperties
Properties
- LongNamestring optional
The network operator's long-format name.
- NetworkIdstring
Network ID.
- ShortNamestring optional
The network operator's short-format name.
- Statusstring
Network availability.
- Technologystring
Access technology used by the network.
GlobalPolicy
Properties
- AllowOnlyPolicyNetworksToAutoconnectboolean optional
If true, only policy networks may auto connect. Defaults to false.
- AllowOnlyPolicyNetworksToConnectboolean optional
If true, only policy networks may be connected to and no new networks may be added or configured. Defaults to false.
- AllowOnlyPolicyNetworksToConnectIfAvailableboolean optional
Since Chrome 70.
If true and a managed network is available in the visible network list, only policy networks may be connected to and no new networks may be added or configured. Defaults to false.
- BlockedHexSSIDsstring[] optional
Since Chrome 86.
List of blocked networks. Connections to blocked networks are prohibited. Networks can be unblocked again by specifying an explicit network configuration. Defaults to an empty list.
IPConfigProperties
Properties
- ExcludedRoutesstring[] optional
Since Chrome 76.
Array of IP blocks in CIDR notation, see onc_spec.md for details.
- Gatewaystring optional
Gateway address used for the IP configuration.
- IPAddressstring optional
The IP address for a connection. Can be IPv4 or IPv6 address, depending on value of
Type
. - IncludedRoutesstring[] optional
Since Chrome 76.
Array of IP blocks in CIDR notation, see onc_spec.md for details.
- NameServersstring[] optional
Array of addresses used for name servers.
- RoutingPrefixnumber optional
The routing prefix.
- SearchDomainsstring[] optional
Since Chrome 76.
Array of strings for name resolution, see onc_spec.md for details.
- Typestring optional
The IP configuration type. Can be
IPv4
orIPv6
. - WebProxyAutoDiscoveryUrlstring optional
The URL for WEb Proxy Auto-Discovery, as reported over DHCP.
IssuerSubjectPattern
Properties
- CommonNamestring optional
If set, the value against which to match the certificate subject's common name.
- Localitystring optional
If set, the value against which to match the certificate subject's common location.
- Organizationstring optional
If set, the value against which to match the certificate subject's organizations. At least one organization should match the value.
- OrganizationalUnitstring optional
If set, the value against which to match the certificate subject's organizational units. At least one organizational unit should match the value.
ManagedBoolean
Properties
- Activeboolean optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicyboolean optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingboolean optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicyboolean optional
The property value provided by the user policy.
- UserSettingboolean optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedCellularProperties
Properties
- ActivationStateActivationStateType optional
- ActivationTypestring optional
- AllowRoamingboolean optional
- AutoConnectManagedBoolean optional
- Familystring optional
- FirmwareRevisionstring optional
- FoundNetworksFoundNetworkProperties[] optional
- HardwareRevisionstring optional
- HomeProviderCellularProviderProperties[] optional
- Manufacturerstring optional
- ModelIDstring optional
- NetworkTechnologystring optional
- PaymentPortalPaymentPortal optional
- RoamingStatestring optional
- SIMLockStatusSIMLockStatus optional
- SIMPresentboolean optional
- Scanningboolean optional
Since Chrome 63.
- ServingOperatorCellularProviderProperties optional
- SignalStrengthnumber optional
- SupportNetworkScanboolean optional
ManagedDOMString
Properties
- Activestring optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicystring optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingstring optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicystring optional
The property value provided by the user policy.
- UserSettingstring optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedDOMStringList
Properties
- Activestring[] optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicystring[] optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingstring[] optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicystring[] optional
The property value provided by the user policy.
- UserSettingstring[] optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedEthernetProperties
Properties
- AuthenticationManagedDOMString optional
- AutoConnectManagedBoolean optional
ManagedIPConfigProperties
Properties
- GatewayManagedDOMString optional
- IPAddressManagedDOMString optional
- NameServersManagedDOMStringList optional
- RoutingPrefixManagedLong optional
- TypeManagedDOMString optional
- WebProxyAutoDiscoveryUrlManagedDOMString optional
ManagedIPConfigType
Properties
- ActiveIPConfigType optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicyIPConfigType optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingIPConfigType optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicyIPConfigType optional
The property value provided by the user policy.
- UserSettingIPConfigType optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedLong
Properties
- Activenumber optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicynumber optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingnumber optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicynumber optional
The property value provided by the user policy.
- UserSettingnumber optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedManualProxySettings
Properties
- FTPProxyManagedProxyLocation optional
- HTTPProxyManagedProxyLocation optional
- SOCKSManagedProxyLocation optional
- SecureHTTPProxyManagedProxyLocation optional
ManagedProperties
Properties
- CellularManagedCellularProperties optional
- Connectableboolean optional
- ConnectionStateConnectionStateType optional
- ErrorStatestring optional
- EthernetManagedEthernetProperties optional
- GUIDstring
- IPAddressConfigTypeManagedIPConfigType optional
- IPConfigsIPConfigProperties[] optional
- MacAddressstring optional
- MeteredManagedBoolean optional
Since Chrome 85.
- NameManagedDOMString optional
- NameServersConfigTypeManagedIPConfigType optional
- PriorityManagedLong optional
- ProxySettingsManagedProxySettings optional
- RestrictedConnectivityboolean optional
- SavedIPConfigIPConfigProperties optional
- Sourcestring optional
- StaticIPConfigManagedIPConfigProperties optional
- Type
- VPNManagedVPNProperties optional
- WiFiManagedWiFiProperties optional
ManagedProxyLocation
Properties
- Host
See
ProxyLocation.Host
. - Port
See
ProxyLocation.Port
.
ManagedProxySettings
Properties
- ExcludeDomainsManagedDOMStringList optional
- ManualManagedManualProxySettings optional
See
ProxySettings.Manual
. - PACManagedDOMString optional
See
ProxySettings.PAC
. See
ProxySettings.Type
.
ManagedProxySettingsType
Properties
- ActiveProxySettingsType optional
The active value currently used by the network configuration manager (e.g. Shill).
- DeviceEditableboolean optional
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
. - DevicePolicyProxySettingsType optional
The property value provided by the device policy.
- Effectivestring optional
The source from which the effective property value was determined.
- SharedSettingProxySettingsType optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. - UserEditableboolean optional
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
. - UserPolicyProxySettingsType optional
The property value provided by the user policy.
- UserSettingProxySettingsType optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedThirdPartyVPNProperties
Properties
- ExtensionID
- ProviderNamestring optional
ManagedVPNProperties
Properties
- AutoConnectManagedBoolean optional
- HostManagedDOMString optional
See
VPNProperties.Host
. - TypeManagedDOMString optional
See
VPNProperties.Type
.
ManagedWiFiProperties
Properties
- AllowGatewayARPPollingManagedBoolean optional
- AutoConnectManagedBoolean optional
- BSSIDstring optional
See
WiFiProperties.BSSID
. - Frequencynumber optional
- FrequencyListnumber[] optional
- HexSSIDManagedDOMString optional
- HiddenSSIDManagedBoolean optional
- RoamThresholdManagedLong optional
Deprecated, ignored. See
WiFiProperties.RoamThreshold
. - SSIDManagedDOMString optional
See
WiFiProperties.SSID
. - Security
- SignalStrengthnumber optional
ManualProxySettings
Properties
- FTPProxyProxyLocation optional
Settings for FTP proxy.
- HTTPProxyProxyLocation optional
Settings for HTTP proxy.
- SOCKSProxyLocation optional
Settings for SOCKS proxy.
- SecureHTTPProxyProxyLocation optional
Settings for secure HTTP proxy.
NetworkConfigProperties
Properties
- CellularCellularProperties optional
- EthernetEthernetProperties optional
- GUIDstring optional
- IPAddressConfigTypeIPConfigType optional
- Namestring optional
- NameServersConfigTypeIPConfigType optional
- Prioritynumber optional
- TypeNetworkType optional
- VPNVPNProperties optional
- WiFiWiFiProperties optional
- WiMAXWiMAXProperties optional
Deprecated.
NetworkFilter
Properties
- configuredboolean optional
If true, only include configured (saved) networks. Defaults to 'false'.
- limitnumber optional
Maximum number of networks to return. Defaults to 1000 if unspecified. Use 0 for no limit.
- networkType
The type of networks to return.
- visibleboolean optional
If true, only include visible (physically connected or in-range) networks. Defaults to 'false'.
NetworkProperties
Properties
- CellularCellularProperties optional
For cellular networks, cellular network properties.
- Connectableboolean optional
Whether the network is connectable.
- ConnectionStateConnectionStateType optional
The network's current connection state.
- ErrorStatestring optional
The last recorded network error state.
- EthernetEthernetProperties optional
For Ethernet networks, the Ethernet network properties.
- GUIDstring
The network GUID.
- IPAddressConfigTypeIPConfigType optional
The network's IP address configuration type.
- IPConfigsIPConfigProperties[] optional
The network's IP configuration.
- MacAddressstring optional
The network's MAC address.
- Meteredboolean optional
Since Chrome 85.
Whether the network is metered.
- Namestring optional
A user friendly network name.
- NameServersConfigTypeIPConfigType optional
The IP configuration type for the name servers used by the network.
- Prioritynumber optional
The network priority.
- ProxySettingsProxySettings optional
The network's proxy settings.
- RestrictedConnectivityboolean optional
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.
- SavedIPConfigIPConfigProperties optional
IP configuration that was received from the DHCP server before applying static IP configuration.
- Sourcestring optional
Indicates whether and how the network is configured. Possible values are:
Device
DevicePolicy
User
UserPolicy
None
'None' conflicts with extension code generation so we must use a string for 'Source' instead of a SourceType enum.
- StaticIPConfigIPConfigProperties optional
The network's static IP configuration.
- Type
The network type.
- VPNVPNProperties optional
For VPN networks, the network VPN properties.
- WiFiWiFiProperties optional
For WiFi networks, the network WiFi properties.
NetworkStateProperties
Properties
- CellularCellularStateProperties optional
- Connectableboolean optional
- ConnectionStateConnectionStateType optional
- ErrorStatestring optional
- EthernetEthernetStateProperties optional
- GUIDstring
- Namestring optional
- Prioritynumber optional
- Sourcestring optional
- Type
- VPNVPNStateProperties optional
- WiFiWiFiStateProperties optional
PaymentPortal
Properties
- Methodstring
The HTTP method to use for the payment portal.
- PostDatastring optional
The post data to send to the payment portal. Ignored unless
Method
isPOST
. - Urlstring optional
The payment portal URL.
ProxyLocation
Properties
- Hoststring
The proxy IP address host.
- Portnumber
The port to use for the proxy.
ProxySettings
Properties
- ExcludeDomainsstring[] optional
Domains and hosts for which manual proxy settings are excluded.
- ManualManualProxySettings optional
Manual proxy settings - used only for
Manual
proxy settings. - PACstring optional
URL for proxy auto-configuration file.
The type of proxy settings.
SIMLockStatus
Properties
- LockEnabledboolean
Whether SIM lock is enabled.
- LockTypestring
The status of SIM lock - possible values are
'sim-pin'
,'sim-puk'
and''
. - RetriesLeftnumber optional
Number of PIN lock tries allowed before PUK is required to unlock the SIM.
ThirdPartyVPNProperties
Properties
- ExtensionIDstring
ID of the third-party VPN provider extension.
- ProviderNamestring optional
The VPN provider name.
VPNProperties
Properties
- AutoConnectboolean optional
Whether the VPN network should be connected automatically.
- Hoststring optional
The VPN host.
- Typestring optional
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.
VPNStateProperties
Properties
- Typestring
See
VPNProperties.Type
.
WiFiProperties
Properties
- AllowGatewayARPPollingboolean optional
Whether ARP polling of default gateway is allowed. Defaults to true.
- AutoConnectboolean optional
Whether the WiFi network should be connected automatically when in range.
- BSSIDstring optional
The BSSID of the associated access point..
- EAPEAPProperties optional
The network EAP properties. Required for
WEP-8021X
andWPA-EAP
networks. - Frequencynumber optional
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.
- FrequencyListnumber[] optional
Contains all operating frequency recently seen for the WiFi network.
- HexSSIDstring optional
HEX-encoded copy of the network SSID.
- HiddenSSIDboolean optional
Whether the network SSID will be broadcast.
- Passphrasestring optional
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. - RoamThresholdnumber optional
Deprecated, ignored.
- SSIDstring optional
The network SSID.
- Securitystring optional
The network security type.
- SignalStrengthnumber optional
The network signal strength.
WiFiStateProperties
Properties
- BSSIDstring optional
See
WiFiProperties.BSSID
. - Frequencynumber optional
- HexSSIDstring optional
Since Chrome 62.
- SSIDstring optional
Since Chrome 62.
See
WiFiProperties.SSID
. - Securitystring
- SignalStrengthnumber optional
WiMAXProperties
Properties
- AutoConnectboolean optional
Whether the network should be connected automatically.
- EAPEAPProperties optional
The network EAP properties.
ActivationStateType
Enum
"Activated"
, "Activating"
, "NotActivated"
, or "PartiallyActivated"
CaptivePortalStatus
Enum
"Unknown"
, "Offline"
, "Online"
, "Portal"
, or "ProxyAuthRequired"
ClientCertificateType
Enum
"Ref"
, or "Pattern"
ConnectionStateType
Enum
"Connected"
, "Connecting"
, or "NotConnected"
DeviceStateType
Enum
"Uninitialized"
, "Disabled"
, "Enabling"
, "Enabled"
, or "Prohibited"
IPConfigType
Enum
"DHCP"
, or "Static"
NetworkType
Enum
"All"
, "Cellular"
, "Ethernet"
, "Tether"
, "VPN"
, "Wireless"
, or "WiFi"
ProxySettingsType
Enum
"Direct"
, "Manual"
, "PAC"
, or "WPAD"
Methods
createNetwork
networking.onc.createNetwork(shared: boolean, properties: NetworkConfigProperties, callback: function)
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
- sharedboolean
If <code>true</code>, share this network configuration with other users. <b>This option is exposed only to Chrome's Web UI.</b> When called by apps, <code>false</code> is the only allowed value.
- properties
The properties to configure the new network with.
- callbackfunction
Called with the GUID for the new network configuration once the network has been created.
The callback parameter should be a function that looks like this:
(result: string) => {...}
- resultstring
disableNetworkType
networking.onc.disableNetworkType(networkType: NetworkType)
Disables any devices matching the specified network type. See note for enableNetworkType
.
Parameters
- networkType
The type of network to disable.
enableNetworkType
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
The type of network to enable.
forgetNetwork
networking.onc.forgetNetwork(networkGuid: string, callback: function)
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
- networkGuidstring
The GUID of the network to forget.
- callbackfunction
Called when the operation has completed.
The callback parameter should be a function that looks like this:
() => {...}
getCaptivePortalStatus
networking.onc.getCaptivePortalStatus(networkGuid: string, callback: function)
Returns captive portal status for the network matching 'networkGuid'.
Parameters
- networkGuidstring
The GUID of the network to get captive portal status for.
- callbackfunction
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:
(result: CaptivePortalStatus) => {...}
- result
getDeviceStates
networking.onc.getDeviceStates(callback: function)
Returns states of available networking devices.
Parameters
- callbackfunction
Called with a list of devices and their state.
The callback parameter should be a function that looks like this:
(result: DeviceStateProperties[]) => {...}
- result
getGlobalPolicy
networking.onc.getGlobalPolicy(callback: function)
Gets the global policy properties. These properties are not expected to change during a session.
Parameters
- callbackfunction
The callback parameter should be a function that looks like this:
(result: GlobalPolicy) => {...}
- result
getManagedProperties
networking.onc.getManagedProperties(networkGuid: string, callback: function)
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
- networkGuidstring
The GUID of the network to get properties for.
- callbackfunction
Called with the managed network properties when received.
The callback parameter should be a function that looks like this:
(result: ManagedProperties) => {...}
- result
getNetworks
networking.onc.getNetworks(filter: NetworkFilter, callback: function)
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
- filter
Describes which networks to return.
- callbackfunction
Called with a dictionary of networks and their state properties when received.
The callback parameter should be a function that looks like this:
(result: NetworkStateProperties[]) => {...}
- result
getProperties
networking.onc.getProperties(networkGuid: string, callback: function)
Gets all the properties of the network with id networkGuid. Includes all properties of the network (read-only and read/write values).
Parameters
- networkGuidstring
The GUID of the network to get properties for.
- callbackfunction
Called with the network properties when received.
The callback parameter should be a function that looks like this:
(result: NetworkProperties) => {...}
- result
getState
networking.onc.getState(networkGuid: string, callback: function)
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
- networkGuidstring
The GUID of the network to get properties for.
- callbackfunction
Called immediately with the network state properties.
The callback parameter should be a function that looks like this:
(result: NetworkStateProperties) => {...}
- result
requestNetworkScan
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
Since Chrome 63.
If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported.
setProperties
networking.onc.setProperties(networkGuid: string, properties: NetworkConfigProperties, callback: function)
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
- networkGuidstring
The GUID of the network to set properties for.
- properties
The properties to set.
- callbackfunction
Called when the operation has completed.
The callback parameter should be a function that looks like this:
() => {...}
startConnect
networking.onc.startConnect(networkGuid: string, callback: function)
Starts a connection to the network with networkGuid.
Parameters
- networkGuidstring
The GUID of the network to connect to.
- callbackfunction
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.The callback parameter should be a function that looks like this:
() => {...}
startDisconnect
networking.onc.startDisconnect(networkGuid: string, callback: function)
Starts a disconnect from the network with networkGuid.
Parameters
- networkGuidstring
The GUID of the network to disconnect from.
- callbackfunction
Called when the disconnect request has been sent. See note for
startConnect
.The callback parameter should be a function that looks like this:
() => {...}
Events
onDeviceStateListChanged
networking.onc.onDeviceStateListChanged.addListener(listener: function)
Fired when the list of devices has changed or any device state properties have changed.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
() => {...}
onNetworkListChanged
networking.onc.onNetworkListChanged.addListener(listener: function)
Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
(changes: string[]) => {...}
- changesstring[]
onNetworksChanged
networking.onc.onNetworksChanged.addListener(listener: function)
Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
(changes: string[]) => {...}
- changesstring[]
onPortalDetectionCompleted
networking.onc.onPortalDetectionCompleted.addListener(listener: function)
Fired when a portal detection for a network completes. Sends the GUID of the network and the corresponding captive portal status.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
(networkGuid: string, status: CaptivePortalStatus) => {...}
- networkGuidstring
- status