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
Availability
Types
ActivationStateType
Enum
"Activated" "Activating" "NotActivated" "PartiallyActivated"
CaptivePortalStatus
Enum
"Unknown" "Offline" "Online" "Portal" "ProxyAuthRequired"
CellularProperties
Properties
-
ActivationState
ActivationStateType optional
Carrier account activation state.
-
ActivationType
string optional
The cellular network activation type.
-
AllowRoaming
boolean optional
Whether roaming is allowed for the network.
-
AutoConnect
boolean optional
Whether the cellular network should be connected automatically (when in range).
-
Family
string optional
Cellular device technology family -
CDMA
orGSM
. -
FirmwareRevision
string optional
The firmware revision loaded in the cellular modem.
-
FoundNetworks
FoundNetworkProperties[] optional
The list of networks found during the most recent network scan.
-
HardwareRevision
string optional
The cellular modem hardware revision.
-
HomeProvider
CellularProviderProperties optional
Information about the operator that issued the SIM card currently installed in the modem.
-
Manufacturer
string optional
The cellular modem manufacturer.
-
ModelID
string optional
The cellular modem model ID.
-
NetworkTechnology
string optional
If the modem is registered on a network, the network technology currently in use.
-
PaymentPortal
PaymentPortal optional
Online payment portal a user can use to sign-up for or modify a mobile data plan.
-
RoamingState
string optional
The roaming state of the cellular modem on the current network.
-
SIMLockStatus
SIMLockStatus optional
The state of SIM lock for GSM family networks.
-
SIMPresent
boolean optional
Whether a SIM card is present.
-
Scanning
boolean optional
Chrome 63+True when a cellular network scan is in progress.
-
ServingOperator
CellularProviderProperties optional
Information about the operator on whose network the modem is currently registered.
-
SignalStrength
number optional
The current network signal strength.
-
SupportNetworkScan
boolean optional
Whether the cellular network supports scanning.
CellularProviderProperties
Properties
-
Code
string
Cellular network ID as a simple concatenation of the network's MCC (Mobile Country Code) and MNC (Mobile Network Code).
-
Country
string optional
The two-letter country code.
-
Name
string
The operator name.
CellularStateProperties
Properties
-
ActivationState
ActivationStateType optional
-
NetworkTechnology
string optional
-
RoamingState
string optional
-
SIMPresent
boolean optional
-
SignalStrength
number optional
CertificatePattern
Properties
-
EnrollmentURI
string[] optional
List of URIs to which the user can be directed in case no certificates that match this pattern are found.
-
Issuer
IssuerSubjectPattern optional
If set, pattern against which X.509 issuer settings should be matched.
-
IssuerCARef
string[] optional
List of certificate issuer CA certificates. A certificate must be signed by one of them in order to match this pattern.
-
Subject
IssuerSubjectPattern optional
If set, pattern against which X.509 subject settings should be matched.
ClientCertificateType
Enum
"Ref" "Pattern"
ConnectionStateType
Enum
"Connected" "Connecting" "NotConnected"
DeviceStateProperties
Properties
-
SIMLockStatus
SIMLockStatus optional
Chrome 62+The SIM lock status if Type = Cellular and SIMPresent = True.
-
SIMPresent
boolean optional
Chrome 62+Set to the SIM present state if the device type is Cellular.
-
Scanning
boolean 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).
DeviceStateType
Enum
"Uninitialized" "Disabled" "Enabling" "Enabled" "Prohibited"
Device is available but not initialized.
Device is initialized but not enabled.
Enabled state has been requested but has not completed.
Device is enabled.
Device is prohibited.
EAPProperties
Properties
-
AnonymousIdentity
string optional
-
ClientCertPKCS11Id
string optional
Chrome 60+ -
ClientCertPattern
CertificatePattern optional
-
ClientCertProvisioningProfileId
string optional
Chrome 93+ -
ClientCertRef
string optional
-
ClientCertType
-
Identity
string optional
-
Inner
string optional
-
Outer
string optional
The outer EAP type. Required by ONC, but may not be provided when translating from Shill.
-
Password
string optional
-
SaveCredentials
boolean optional
-
ServerCAPEMs
string[] optional
-
ServerCARefs
string[] optional
-
SubjectMatch
ManagedDOMString optional
Chrome 60+ -
UseProactiveKeyCaching
boolean optional
-
UseSystemCAs
boolean optional
EthernetProperties
Properties
-
Authentication
string optional
The authentication used by the Ethernet network. Possible values are
None
and8021X
. -
AutoConnect
boolean optional
Whether the Ethernet network should be connected automatically.
-
EAP
EAPProperties optional
Network's EAP settings. Required for 8021X authentication.
EthernetStateProperties
Properties
-
Authentication
string
FoundNetworkProperties
Properties
-
LongName
string optional
The network operator's long-format name.
-
NetworkId
string
Network ID.
-
ShortName
string optional
The network operator's short-format name.
-
Status
string
Network availability.
-
Technology
string
Access technology used by the network.
GlobalPolicy
Properties
-
AllowOnlyPolicyNetworksToAutoconnect
boolean optional
If true, only policy networks may auto connect. Defaults to false.
-
AllowOnlyPolicyNetworksToConnect
boolean optional
If true, only policy networks may be connected to and no new networks may be added or configured. Defaults to false.
-
AllowOnlyPolicyNetworksToConnectIfAvailable
boolean optional
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.
-
BlockedHexSSIDs
string[] optional
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
-
ExcludedRoutes
string[] optional
Chrome 76+Array of IP blocks in CIDR notation, see onc_spec.md for details.
-
Gateway
string optional
Gateway address used for the IP configuration.
-
IPAddress
string optional
The IP address for a connection. Can be IPv4 or IPv6 address, depending on value of
Type
. -
IncludedRoutes
string[] optional
Chrome 76+Array of IP blocks in CIDR notation, see onc_spec.md for details.
-
NameServers
string[] optional
Array of addresses used for name servers.
-
RoutingPrefix
number optional
The routing prefix.
-
SearchDomains
string[] optional
Chrome 76+Array of strings for name resolution, see onc_spec.md for details.
-
Type
string optional
The IP configuration type. Can be
IPv4
orIPv6
. -
WebProxyAutoDiscoveryUrl
string optional
The URL for WEb Proxy Auto-Discovery, as reported over DHCP.
IPConfigType
Enum
"DHCP" "Static"
IssuerSubjectPattern
Properties
-
CommonName
string optional
If set, the value against which to match the certificate subject's common name.
-
Locality
string optional
If set, the value against which to match the certificate subject's common location.
-
Organization
string optional
If set, the value against which to match the certificate subject's organizations. At least one organization should match the value.
-
OrganizationalUnit
string 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
-
Active
boolean optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
boolean optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
boolean optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
boolean optional
The property value provided by the user policy.
-
UserSetting
boolean optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedCellularProperties
Properties
-
ActivationState
ActivationStateType optional
-
ActivationType
string optional
-
AllowRoaming
boolean optional
-
AutoConnect
ManagedBoolean optional
-
Family
string optional
-
FirmwareRevision
string optional
-
FoundNetworks
FoundNetworkProperties[] optional
-
HardwareRevision
string optional
-
HomeProvider
CellularProviderProperties[] optional
-
Manufacturer
string optional
-
ModelID
string optional
-
NetworkTechnology
string optional
-
PaymentPortal
PaymentPortal optional
-
RoamingState
string optional
-
SIMLockStatus
SIMLockStatus optional
-
SIMPresent
boolean optional
-
Scanning
boolean optional
Chrome 63+ -
ServingOperator
CellularProviderProperties optional
-
SignalStrength
number optional
-
SupportNetworkScan
boolean optional
ManagedDOMString
Properties
-
Active
string optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
string optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
string optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
string optional
The property value provided by the user policy.
-
UserSetting
string optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedDOMStringList
Properties
-
Active
string[] optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
string[] optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
string[] optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
string[] optional
The property value provided by the user policy.
-
UserSetting
string[] optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedEthernetProperties
Properties
-
Authentication
ManagedDOMString optional
-
AutoConnect
ManagedBoolean optional
ManagedIPConfigProperties
Properties
-
Gateway
ManagedDOMString optional
-
IPAddress
ManagedDOMString optional
-
NameServers
ManagedDOMStringList optional
-
RoutingPrefix
ManagedLong optional
-
Type
ManagedDOMString optional
-
WebProxyAutoDiscoveryUrl
ManagedDOMString optional
ManagedIPConfigType
Properties
-
Active
IPConfigType optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
IPConfigType optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
IPConfigType optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
IPConfigType optional
The property value provided by the user policy.
-
UserSetting
IPConfigType optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedLong
Properties
-
Active
number optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
number optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
number optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
number optional
The property value provided by the user policy.
-
UserSetting
number optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedManualProxySettings
Properties
-
FTPProxy
ManagedProxyLocation optional
-
HTTPProxy
ManagedProxyLocation optional
-
SOCKS
ManagedProxyLocation optional
-
SecureHTTPProxy
ManagedProxyLocation optional
ManagedProperties
Properties
-
Cellular
ManagedCellularProperties optional
-
Connectable
boolean optional
-
ConnectionState
ConnectionStateType optional
-
ErrorState
string optional
-
Ethernet
ManagedEthernetProperties optional
-
GUID
string
-
IPAddressConfigType
ManagedIPConfigType optional
-
IPConfigs
IPConfigProperties[] optional
-
MacAddress
string optional
-
Metered
ManagedBoolean optional
Chrome 85+ -
Name
ManagedDOMString optional
-
NameServersConfigType
ManagedIPConfigType optional
-
Priority
ManagedLong optional
-
ProxySettings
ManagedProxySettings optional
-
RestrictedConnectivity
boolean optional
-
SavedIPConfig
IPConfigProperties optional
-
Source
string optional
-
StaticIPConfig
ManagedIPConfigProperties optional
-
TrafficCounterResetTime
number optional
Chrome 125+ -
Type
-
VPN
ManagedVPNProperties optional
-
WiFi
ManagedWiFiProperties optional
ManagedProxyLocation
Properties
-
Host
See
ProxyLocation.Host
. -
Port
See
ProxyLocation.Port
.
ManagedProxySettings
Properties
-
ExcludeDomains
ManagedDOMStringList optional
-
Manual
ManagedManualProxySettings optional
See
ProxySettings.Manual
. -
PAC
ManagedDOMString optional
See
ProxySettings.PAC
. -
See
ProxySettings.Type
.
ManagedProxySettingsType
Properties
-
Active
ProxySettingsType optional
The active value currently used by the network configuration manager (e.g. Shill).
-
DeviceEditable
boolean 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
. -
DevicePolicy
ProxySettingsType optional
The property value provided by the device policy.
-
Effective
string optional
The source from which the effective property value was determined.
-
ProxySettingsType optional
The value set for all users of the device. Only provided if
DeviceEditiable
istrue
. -
UserEditable
boolean 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
. -
UserPolicy
ProxySettingsType optional
The property value provided by the user policy.
-
UserSetting
ProxySettingsType optional
The property value set by the logged in user. Only provided if
UserEditable
istrue
.
ManagedThirdPartyVPNProperties
Properties
-
ExtensionID
-
ProviderName
string optional
ManagedVPNProperties
Properties
-
AutoConnect
ManagedBoolean optional
-
Host
ManagedDOMString optional
See
VPNProperties.Host
. -
Type
ManagedDOMString optional
See
VPNProperties.Type
.
ManagedWiFiProperties
Properties
-
AllowGatewayARPPolling
ManagedBoolean optional
-
AutoConnect
ManagedBoolean optional
-
BSSID
string optional
See
WiFiProperties.BSSID
. -
Frequency
number optional
-
FrequencyList
number[] optional
-
HexSSID
ManagedDOMString optional
-
HiddenSSID
ManagedBoolean optional
-
RoamThreshold
ManagedLong optional
Deprecated, ignored. See
WiFiProperties.RoamThreshold
. -
SSID
ManagedDOMString optional
See
WiFiProperties.SSID
. -
Security
-
SignalStrength
number optional
ManualProxySettings
Properties
-
FTPProxy
ProxyLocation optional
Settings for FTP proxy.
-
HTTPProxy
ProxyLocation optional
Settings for HTTP proxy.
-
SOCKS
ProxyLocation optional
Settings for SOCKS proxy.
-
SecureHTTPProxy
ProxyLocation optional
Settings for secure HTTP proxy.
NetworkConfigProperties
Properties
-
Cellular
CellularProperties optional
-
Ethernet
EthernetProperties optional
-
GUID
string optional
-
IPAddressConfigType
IPConfigType optional
-
Name
string optional
-
NameServersConfigType
IPConfigType optional
-
Priority
number optional
-
Type
NetworkType optional
-
VPN
VPNProperties optional
-
WiFi
WiFiProperties optional
-
WiMAX
WiMAXProperties optional
Deprecated.
NetworkFilter
Properties
-
configured
boolean optional
If true, only include configured (saved) networks. Defaults to 'false'.
-
limit
number optional
Maximum number of networks to return. Defaults to 1000 if unspecified. Use 0 for no limit.
-
networkType
The type of networks to return.
-
visible
boolean optional
If true, only include visible (physically connected or in-range) networks. Defaults to 'false'.
NetworkProperties
Properties
-
Cellular
CellularProperties optional
For cellular networks, cellular network properties.
-
Connectable
boolean optional
Whether the network is connectable.
-
ConnectionState
ConnectionStateType optional
The network's current connection state.
-
ErrorState
string optional
The last recorded network error state.
-
Ethernet
EthernetProperties optional
For Ethernet networks, the Ethernet network properties.
-
GUID
string
The network GUID.
-
IPAddressConfigType
IPConfigType optional
The network's IP address configuration type.
-
IPConfigs
IPConfigProperties[] optional
The network's IP configuration.
-
MacAddress
string optional
The network's MAC address.
-
Metered
boolean optional
Chrome 85+Whether the network is metered.
-
Name
string optional
A user friendly network name.
-
NameServersConfigType
IPConfigType optional
The IP configuration type for the name servers used by the network.
-
Priority
number optional
The network priority.
-
ProxySettings
ProxySettings optional
The network's proxy settings.
-
RestrictedConnectivity
boolean 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.
-
SavedIPConfig
IPConfigProperties optional
IP configuration that was received from the DHCP server before applying static IP configuration.
-
Source
string 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.
-
StaticIPConfig
IPConfigProperties optional
The network's static IP configuration.
-
TrafficCounterResetTime
number optional
Chrome 125+When traffic counters were last reset.
-
Type
The network type.
-
VPN
VPNProperties optional
For VPN networks, the network VPN properties.
-
WiFi
WiFiProperties optional
For WiFi networks, the network WiFi properties.
NetworkStateProperties
Properties
-
Cellular
CellularStateProperties optional
-
Connectable
boolean optional
-
ConnectionState
ConnectionStateType optional
-
ErrorState
string optional
-
Ethernet
EthernetStateProperties optional
-
GUID
string
-
Name
string optional
-
Priority
number optional
-
Source
string optional
-
Type
-
VPN
VPNStateProperties optional
-
WiFi
WiFiStateProperties optional
NetworkType
Enum
"All" "Cellular" "Ethernet" "Tether" "VPN" "Wireless" "WiFi"
PaymentPortal
Properties
-
Method
string
The HTTP method to use for the payment portal.
-
PostData
string optional
The post data to send to the payment portal. Ignored unless
Method
isPOST
. -
Url
string optional
The payment portal URL.
ProxyLocation
Properties
-
Host
string
The proxy IP address host.
-
Port
number
The port to use for the proxy.
ProxySettings
Properties
-
ExcludeDomains
string[] optional
Domains and hosts for which manual proxy settings are excluded.
-
Manual
ManualProxySettings optional
Manual proxy settings - used only for
Manual
proxy settings. -
PAC
string optional
URL for proxy auto-configuration file.
-
Type
The type of proxy settings.
ProxySettingsType
Enum
"Direct" "Manual" "PAC" "WPAD"
SIMLockStatus
Properties
-
LockEnabled
boolean
Whether SIM lock is enabled.
-
LockType
string
The status of SIM lock - possible values are
'sim-pin'
,'sim-puk'
and''
. -
RetriesLeft
number optional
Number of PIN lock tries allowed before PUK is required to unlock the SIM.
ThirdPartyVPNProperties
Properties
-
ExtensionID
string
ID of the third-party VPN provider extension.
-
ProviderName
string optional
The VPN provider name.
VPNProperties
Properties
-
AutoConnect
boolean optional
Whether the VPN network should be connected automatically.
-
Host
string optional
The VPN host.
-
Type
string 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
-
Type
string
See
VPNProperties.Type
.
WiFiProperties
Properties
-
AllowGatewayARPPolling
boolean optional
DeprecatedRemoved in M131. There is no active ARP polling now.
-
AutoConnect
boolean optional
Whether the WiFi network should be connected automatically when in range.
-
BSSID
string optional
The BSSID of the associated access point..
-
EAP
EAPProperties optional
The network EAP properties. Required for
WEP-8021X
andWPA-EAP
networks. -
Frequency
number 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.
-
FrequencyList
number[] optional
Contains all operating frequency recently seen for the WiFi network.
-
HexSSID
string optional
HEX-encoded copy of the network SSID.
-
HiddenSSID
boolean optional
Whether the network SSID will be broadcast.
-
Passphrase
string optional
Chrome 66+The passphrase for WEP/WPA/WPA2 connections. This property can only be set - properties returned by
getProperties
will not contain this value. -
RoamThreshold
number optional
Deprecated, ignored.
-
SSID
string optional
The network SSID.
-
Security
string optional
The network security type.
-
SignalStrength
number optional
The network signal strength.
WiFiStateProperties
Properties
-
BSSID
string optional
See
WiFiProperties.BSSID
. -
Frequency
number optional
-
HexSSID
string optional
Chrome 62+ -
SSID
string optional
Chrome 62+See
WiFiProperties.SSID
. -
Security
string
-
SignalStrength
number optional
WiMAXProperties
Properties
-
AutoConnect
boolean optional
Whether the network should be connected automatically.
-
EAP
EAPProperties optional
The network EAP properties.
Methods
createNetwork()
chrome.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
-
boolean
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. -
properties
The properties to configure the new network with.
-
callback
function optional
The
callback
parameter looks like:(result: string) => void
-
result
string
-
Returns
-
Promise<string>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
disableNetworkType()
chrome.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()
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
The type of network to enable.
forgetNetwork()
chrome.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
-
networkGuid
string
The GUID of the network to forget.
-
callback
function optional
The
callback
parameter looks like:() => void
Returns
-
Promise<void>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getCaptivePortalStatus()
chrome.networking.onc.getCaptivePortalStatus(
networkGuid: string,
callback?: function,
)
Returns captive portal status for the network matching 'networkGuid'.
Parameters
-
networkGuid
string
The GUID of the network to get captive portal status for.
-
callback
function optional
The
callback
parameter looks like:(result: CaptivePortalStatus) => void
-
result
-
Returns
-
Promise<CaptivePortalStatus>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getDeviceStates()
chrome.networking.onc.getDeviceStates(
callback?: function,
)
Returns states of available networking devices.
Parameters
-
callback
function optional
The
callback
parameter looks like:(result: DeviceStateProperties[]) => void
-
result
-
Returns
-
Promise<DeviceStateProperties[]>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getGlobalPolicy()
chrome.networking.onc.getGlobalPolicy(
callback?: function,
)
Gets the global policy properties. These properties are not expected to change during a session.
Parameters
-
callback
function optional
The
callback
parameter looks like:(result: GlobalPolicy) => void
-
result
-
Returns
-
Promise<GlobalPolicy>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getManagedProperties()
chrome.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
-
networkGuid
string
The GUID of the network to get properties for.
-
callback
function optional
The
callback
parameter looks like:(result: ManagedProperties) => void
-
result
-
Returns
-
Promise<ManagedProperties>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getNetworks()
chrome.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.
-
callback
function optional
The
callback
parameter looks like:(result: NetworkStateProperties[]) => void
-
result
-
Returns
-
Promise<NetworkStateProperties[]>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getProperties()
chrome.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
-
networkGuid
string
The GUID of the network to get properties for.
-
callback
function optional
The
callback
parameter looks like:(result: NetworkProperties) => void
-
result
-
Returns
-
Promise<NetworkProperties>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
getState()
chrome.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
-
networkGuid
string
The GUID of the network to get properties for.
-
callback
function optional
The
callback
parameter looks like:(result: NetworkStateProperties) => void
-
result
-
Returns
-
Promise<NetworkStateProperties>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
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
NetworkType optional
Chrome 63+If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported.
setProperties()
chrome.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
-
networkGuid
string
The GUID of the network to set properties for.
-
properties
The properties to set.
-
callback
function optional
The
callback
parameter looks like:() => void
Returns
-
Promise<void>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
startConnect()
chrome.networking.onc.startConnect(
networkGuid: string,
callback?: function,
)
Starts a connection to the network with networkGuid.
Parameters
-
networkGuid
string
The GUID of the network to connect to.
-
callback
function optional
The
callback
parameter looks like:() => void
Returns
-
Promise<void>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
startDisconnect()
chrome.networking.onc.startDisconnect(
networkGuid: string,
callback?: function,
)
Starts a disconnect from the network with networkGuid.
Parameters
-
networkGuid
string
The GUID of the network to disconnect from.
-
callback
function optional
The
callback
parameter looks like:() => void
Returns
-
Promise<void>
Chrome 125+Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.
Events
onDeviceStateListChanged
chrome.networking.onc.onDeviceStateListChanged.addListener(
callback: function,
)
Fired when the list of devices has changed or any device state properties have changed.
Parameters
-
callback
function
The
callback
parameter looks like:() => void
onNetworkListChanged
chrome.networking.onc.onNetworkListChanged.addListener(
callback: function,
)
Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks.
Parameters
-
callback
function
The
callback
parameter looks like:(changes: string[]) => void
-
changes
string[]
-
onNetworksChanged
chrome.networking.onc.onNetworksChanged.addListener(
callback: function,
)
Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed.
Parameters
-
callback
function
The
callback
parameter looks like:(changes: string[]) => void
-
changes
string[]
-
onPortalDetectionCompleted
chrome.networking.onc.onPortalDetectionCompleted.addListener(
callback: function,
)
Fired when a portal detection for a network completes. Sends the GUID of the network and the corresponding captive portal status.
Parameters
-
callback
function
The
callback
parameter looks like:(networkGuid: string, status: CaptivePortalStatus) => void
-
networkGuid
string
-
status
-