Methods
createNetwork(shared, properties) → {Promise}
Creates a new network configuration from properties. If a matching configured network already exists, this will fail. Otherwise resolves to the GUID of the new Agent.network.
Parameters:
Name | Type | Description |
---|---|---|
shared |
Boolean |
[false] Always false. |
properties |
Object |
The properties to configure the new network with. |
- See:
-
- ChromeOS API documentation
disableNetworkType(type) → {Promise}
Disables any devices matching the specified network type.
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
The type of network to disable. |
- See:
-
- ChromeOS API documentation
enableNetworkType(type) → {Promise}
Enables any devices matching the specified network type. Note, the type might represent multiple network types (e.g. 'Wireless').
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
The type of network to enable. |
- See:
-
- ChromeOS API documentation
forgetNetwork(guid) → {Promise}
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.
Note: Cannot Delete a Shared Network (Created outside of Kiosk Mode on ChromeOS)
Parameters:
Name | Type | Description |
---|---|---|
guid |
String |
The GUID of the network to forget. |
- See:
-
- ChromeOS API documentation
getCaptivePortalStatus(networkGuid) → {Promise}
Get the captive portal status for the network with the given GUID
Parameters:
Name | Type | Description |
---|---|---|
networkGuid |
String |
The GUID of the network to get captive portal status for. |
- See:
-
- ChromeOS API documentation
getDeviceStates()
Returns states of available networking devices.
- See:
-
- ChromeOS API documentation
getGlobalPolicy() → {Promise}
Gets the global policy properties. These properties are not expected to change during a session.
- See:
-
- ChromeOS API documentation
getManagedProperties(guid) → {Promise}
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:
Name | Type | Description |
---|---|---|
guid |
String |
The GUID of the network |
- See:
-
- ChromeOS API documentation
getNetworks(filter) → {Promise}
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:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
filter |
Object |
Describes which networks to return. Properties
|
- See:
-
- ChromeOS API documentation
getProperties(guid) → {Promise}
Gets all the properties of the network with id networkGuid. Includes all properties of the network (read-only and read/write values).
Parameters:
Name | Type | Description |
---|---|---|
guid |
String |
The GUID of the network |
- See:
-
- ChromeOS API documentation
getState(guid) → {Promise}
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:
Name | Type | Description |
---|---|---|
guid |
String |
The GUID of the network to get properties for. |
- See:
-
- ChromeOS API documentation
onDeviceStateListChanged(callback)
Fired when the list of devices has changed or any device state properties have changed.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Called when the list of device has changed. |
- See:
-
- ChromeOS API documentation
Listens to Events:
- event:networkListChanged
onNetworkListChanged(callback)
Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Called with a complete list of GUIDs for all the current networks. |
- See:
-
- ChromeOS API documentation
Listens to Events:
- event:networkListChanged
onNetworksChanged(callback)
Fired when the properties change on any of the networks. Sends a list of GUIDs for networks whose properties have changed.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Called with a list of GUIDs for networks whose properties have changed. |
- See:
-
- ChromeOS API documentation
Listens to Events:
- event:networksChanged
onPortalDetectionCompleted(callback)
Fired when a portal detection for a network completes. Sends the GUID of the network and the corresponding captive portal status.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Called with a GUID of the network and the corresponding captive portal status. |
- See:
-
- ChromeOS API documentation
Listens to Events:
- event:networkListChanged
requestNetworkScan(type) → {Promise}
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:
Name | Type | Description |
---|---|---|
type |
String |
If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported. (ChromeOS 63+) |
- See:
-
- ChromeOS API documentation
setProperties(guid) → {Promise}
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. Calling this method on a shared network (created outside of Kiosk Mode on ChromeOS) will fail.
Parameters:
Name | Type | Description |
---|---|---|
guid |
String |
The GUID of the network |
- See:
-
- ChromeOS API documentation
startConnect(networkGuid) → {Promise}
Starts a connection to the network with networkGuid.
Parameters:
Name | Type | Description |
---|---|---|
networkGuid |
String |
The GUID of the network to connect to. |
- See:
-
- ChromeOS API documentation
startDisconnect(networkGuid) → {Promise}
Starts a disconnect from the network with networkGuid.
Parameters:
Name | Type | Description |
---|---|---|
networkGuid |
String |
The GUID of the network to disconnect from. |
- See:
-
- ChromeOS API documentation