- Technical documentation
- API docs
Service getProvidedService(DOMString service_name[, isSecure])
Get a provided service.
|service_name||Name of a service.|
|isSecure||Get unsecure or secure service.|
This method can be called only from Node.js applications and spacelets. The available services are the services listed in the provided services field of the manifest.
This method returns an instance of the Service class if the service exists. The return value is null If the service is not in the list of services. If this method is called from a web page the return value is null.
The optional isSecure parameter can be used to define the type of the returned service. Passing false as the value returns unsecure service. Passing true returns secure service. If the parameter is not defined, the service is selected automatically. The selection is based on the following sequence:
1. Return secure service if it is available. 2. If secure service is not available, return unsecure service. 3. If neither of the services is available, return null.