ChromeAppRuntime class
Use the chrome.app.runtime
API to manage the app lifecycle. The app runtime
manages app installation, controls the event page, and can shut down the app
at anytime.
class ChromeAppRuntime extends ChromeApi { static final JsObject _app_runtime = chrome['app']['runtime']; ChromeAppRuntime._(); bool get available => _app_runtime != null; Stream<LaunchData> get onLaunched => _onLaunched.stream; final ChromeStreamController<LaunchData> _onLaunched = new ChromeStreamController<LaunchData>.oneArg(_app_runtime, 'onLaunched', _createLaunchData); Stream get onRestarted => _onRestarted.stream; final ChromeStreamController _onRestarted = new ChromeStreamController.noArgs(_app_runtime, 'onRestarted'); void _throwNotAvailable() { throw new UnsupportedError("'chrome.app.runtime' is not available"); } }
Extends
ChromeApi > ChromeAppRuntime
Properties
final bool available #
Returns true if the API is available. The common causes of an API not being avilable are:
- a permission is missing in the application's manifest.json file
- the API is defined on a newer version of Chrome then the current runtime
docs inherited from ChromeApi
bool get available => _app_runtime != null;
final Stream<LaunchData> onLaunched #
Stream<LaunchData> get onLaunched => _onLaunched.stream;
final Stream onRestarted #
Stream get onRestarted => _onRestarted.stream;