The chrome.networkingPrivate API is used for configuring network connections (Cellular, Ethernet, VPN or WiFi). This private API is only valid if called from a browser or app associated with the primary user. See the Open Network Configuration (ONC) documentation for descriptions of properties:
src/components/onc/docs/onc_spec.html, or the
Open Network Configuration page at chromium.org.
NOTE: Most dictionary properties and enum values use UpperCamelCase to match the ONC spec instead of the JavaScript lowerCamelCase convention.
'State' properties describe just the ONC properties returned by 'networkingPrivate.getState' and 'networkingPrivate.getNetworks'.
'Config' properties describe just the ONC properties that can be configured through this API. NOTE: Not all configuration properties are exposed at this time, only those currently required by the Chrome Settings UI. TODO(stevenjb): Provide all configuration properties and types, crbug.com/380937.
TODO(stevenjb/pneubeck): Merge the ONC documentation with this document and use it as the ONC specification.
The chrome.networkingPrivate API is used for configuring network connections (Cellular, Ethernet, VPN or WiFi). This private API is only valid if called from a browser or app associated with the primary user. See the Open Network Configuration (ONC) documentation for descriptions of properties: src/components/onc/docs/onc_spec.html, or the Open Network Configuration page at chromium.org. NOTE: Most dictionary properties and enum values use UpperCamelCase to match the ONC spec instead of the JavaScript lowerCamelCase convention. 'State' properties describe just the ONC properties returned by 'networkingPrivate.getState' and 'networkingPrivate.getNetworks'. 'Config' properties describe just the ONC properties that can be configured through this API. NOTE: Not all configuration properties are exposed at this time, only those currently required by the Chrome Settings UI. TODO(stevenjb): Provide all configuration properties and types, crbug.com/380937. TODO(stevenjb/pneubeck): Merge the ONC documentation with this document and use it as the ONC specification. * available since Chrome 36
(create-network shared properties)
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.
|shared| - If true, share this network configuration with other users. |properties| - The properties to configure the new network with.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |shared| - If true, share this network configuration with other users. |properties| - The properties to configure the new network with. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(disable-network-type network-type)
Disables any devices matching the specified network type. See note for 'networkingPrivate.enableNetworkType'.
|network-type| - The type of network to disable.
Disables any devices matching the specified network type. See note for 'networkingPrivate.enableNetworkType'. |network-type| - The type of network to disable.
(enable-network-type network-type)
Enables any devices matching the specified network type. Note, the type might represent multiple network types (e.g. 'Wireless').
|network-type| - The type of network to enable.
Enables any devices matching the specified network type. Note, the type might represent multiple network types (e.g. 'Wireless'). |network-type| - The type of network to enable.
(forget-network network-guid)
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.
|network-guid| - The GUID of the network to forget.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |network-guid| - The GUID of the network to forget. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-captive-portal-status network-guid)
Returns captive portal status for the network matching 'networkGuid'.
|network-guid| - The GUID of the network to get captive portal status for.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Returns captive portal status for the network matching 'networkGuid'. |network-guid| - The GUID of the network to get captive portal status for. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-certificate-lists)
Gets the lists of certificates available for network configuration.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets the lists of certificates available for network configuration. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-device-states)
Returns a list of 'networkingPrivate.DeviceStateProperties' objects.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Returns a list of 'networkingPrivate.DeviceStateProperties' objects. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-enabled-network-types)
Deprecated. Please use 'networkingPrivate.getDeviceStates' instead.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Deprecated. Please use 'networkingPrivate.getDeviceStates' instead. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-global-policy)
Gets the global policy properties. These properties are not expected to change during a session.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets the global policy properties. These properties are not expected to change during a session. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-managed-properties network-guid)
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.
|network-guid| - The GUID of the network to get properties for.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |network-guid| - The GUID of the network to get properties for. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-networks filter)
Returns a list of network objects with the same properties provided by 'networkingPrivate.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.
|filter| - Describes which networks to return.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Returns a list of network objects with the same properties provided by 'networkingPrivate.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. |filter| - Describes which networks to return. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-properties network-guid)
Gets all the properties of the network with id networkGuid. Includes all properties of the network (read-only and read/write values).
|network-guid| - The GUID of the network to get properties for.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets all the properties of the network with id networkGuid. Includes all properties of the network (read-only and read/write values). |network-guid| - The GUID of the network to get properties for. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-state network-guid)
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.
|network-guid| - The GUID of the network to get properties for.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |network-guid| - The GUID of the network to get properties for. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(get-visible-networks network-type)
Deprecated. Please use 'networkingPrivate.getNetworks' with filter.visible = true instead.
|network-type| - ?
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - ?
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Deprecated. Please use 'networkingPrivate.getNetworks' with filter.visible = true instead. |network-type| - ? This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - ? In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(request-network-scan)
(request-network-scan network-type)
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.
|network-type| - If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported.
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. |network-type| - If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported.
(select-cellular-mobile-network network-guid network-id)
Selects which Cellular Mobile Network to use. |networkId| must be the NetworkId property of a member of Cellular.FoundNetworks from the network properties for the specified Cellular network.
|network-guid| - The GUID of the cellular network to select the network for. If empty, the default cellular device will be used. |network-id| - The networkId to select.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Selects which Cellular Mobile Network to use. |networkId| must be the NetworkId property of a member of Cellular.FoundNetworks from the network properties for the specified Cellular network. |network-guid| - The GUID of the cellular network to select the network for. If empty, the default cellular device will be used. |network-id| - The networkId to select. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(select-cellular-mobile-network* config network-guid network-id)
(set-cellular-sim-state network-guid sim-state)
Sets whether or not SIM locking is enabled (i.e a PIN will be required when the device is powered) and changes the PIN if a new PIN is specified. If the new PIN is provided but not valid (e.g. too short) the operation will fail. This will not lock the SIM; that is handled automatically by the device. NOTE: If the SIM is locked, it must first be unlocked with unlockCellularSim() before this can be called (otherwise it will fail and 'runtime.lastError' will be set to Error.SimLocked).
|network-guid| - The GUID of the cellular network to set the SIM state of. If empty, the default cellular device will be used. |sim-state| - The SIM state to set.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Sets whether or not SIM locking is enabled (i.e a PIN will be required when the device is powered) and changes the PIN if a new PIN is specified. If the new PIN is provided but not valid (e.g. too short) the operation will fail. This will not lock the SIM; that is handled automatically by the device. NOTE: If the SIM is locked, it must first be unlocked with unlockCellularSim() before this can be called (otherwise it will fail and 'runtime.lastError' will be set to Error.SimLocked). |network-guid| - The GUID of the cellular network to set the SIM state of. If empty, the default cellular device will be used. |sim-state| - The SIM state to set. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(set-properties network-guid properties)
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.
|network-guid| - The GUID of the network to set properties for. |properties| - The properties to set.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |network-guid| - The GUID of the network to set properties for. |properties| - The properties to set. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(start-activate network-guid)
(start-activate network-guid carrier)
Starts activation of the Cellular network with networkGuid. If called for a network that is already activated, or for a network with a carrier that can not be directly activated, this will show the account details page for the carrier if possible.
|network-guid| - The GUID of the Cellular network to activate. |carrier| - Optional name of carrier to activate.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Starts activation of the Cellular network with networkGuid. If called for a network that is already activated, or for a network with a carrier that can not be directly activated, this will show the account details page for the carrier if possible. |network-guid| - The GUID of the Cellular network to activate. |carrier| - Optional name of carrier to activate. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(start-connect network-guid)
Starts a connection to the network with networkGuid.
|network-guid| - The GUID of the network to connect to.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Starts a connection to the network with networkGuid. |network-guid| - The GUID of the network to connect to. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(start-disconnect network-guid)
Starts a disconnect from the network with networkGuid.
|network-guid| - The GUID of the network to disconnect from.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Starts a disconnect from the network with networkGuid. |network-guid| - The GUID of the network to disconnect from. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.app.networking-private namespace.
Taps all valid non-deprecated events in chromex.app.networking-private namespace.
(tap-on-certificate-lists-changed-events channel & args)
Fired when any certificate list has changed.
Events will be put on the |channel| with signature [::on-certificate-lists-changed []].
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when any certificate list has changed. Events will be put on the |channel| with signature [::on-certificate-lists-changed []]. Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
(tap-on-device-state-list-changed-events channel & args)
Fired when the list of devices has changed or any device state properties have changed.
Events will be put on the |channel| with signature [::on-device-state-list-changed []].
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when the list of devices has changed or any device state properties have changed. Events will be put on the |channel| with signature [::on-device-state-list-changed []]. Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
(tap-on-network-list-changed-events channel & args)
Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks.
Events will be put on the |channel| with signature [::on-network-list-changed [changes]] where:
|changes| - ?
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks. Events will be put on the |channel| with signature [::on-network-list-changed [changes]] where: |changes| - ? Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
(tap-on-networks-changed-events channel & args)
Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed.
Events will be put on the |channel| with signature [::on-networks-changed [changes]] where:
|changes| - ?
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed. Events will be put on the |channel| with signature [::on-networks-changed [changes]] where: |changes| - ? Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
(tap-on-portal-detection-completed-events channel & args)
Fired when a portal detection for a network completes. Sends the guid of the network and the corresponding captive portal status.
Events will be put on the |channel| with signature [::on-portal-detection-completed [network-guid status]] where:
|network-guid| - ? |status| - ?
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a portal detection for a network completes. Sends the guid of the network and the corresponding captive portal status. Events will be put on the |channel| with signature [::on-portal-detection-completed [network-guid status]] where: |network-guid| - ? |status| - ? Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
(unlock-cellular-sim network-guid pin)
(unlock-cellular-sim network-guid pin puk)
Unlocks a Cellular SIM card. * If the SIM is PIN locked, |pin| will be used to unlock the SIM and the |puk| argument will be ignored if provided. * If the SIM is PUK locked, |puk| and |pin| must be provided. If the operation succeeds (|puk| is valid), the PIN will be set to |pin|. (If |pin| is empty or invalid the operation will fail).
|network-guid| - The GUID of the cellular network to unlock. If empty, the default cellular device will be used. |pin| - The current SIM PIN, or the new PIN if PUK is provided. |puk| - The operator provided PUK for unblocking a blocked SIM.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Unlocks a Cellular SIM card. * If the SIM is PIN locked, |pin| will be used to unlock the SIM and the |puk| argument will be ignored if provided. * If the SIM is PUK locked, |puk| and |pin| must be provided. If the operation succeeds (|puk| is valid), the PIN will be set to |pin|. (If |pin| is empty or invalid the operation will fail). |network-guid| - The GUID of the cellular network to unlock. If empty, the default cellular device will be used. |pin| - The current SIM PIN, or the new PIN if PUK is provided. |puk| - The operator provided PUK for unblocking a blocked SIM. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close