- Technical documentation
- API docs
Service getRequiredService(DOMString service_name[, isSecure])
Get a required service.
|service_name||Name of a service.|
|isSecure||Get unsecure or secure service.|
This method returns on success an instance of the Service class. The return value is null If the service_name is not defined in the connected services.
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.
Notice! It is not a good practice to connect to the open services of other applications with the connect method. List the required services in the manifest and let the automation provided by the start method make the connections.