chrome.app.runtime
Description: |
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.
|
Availability: |
Since Chrome 35.
|
Summary
Events | |
---|---|
onEmbedRequested | |
onLaunched | |
onRestarted |
Events
onEmbedRequested
Since Chrome 38.
Fired when an embedding app requests to embed this app. This event is only available on dev channel with the flag --enable-app-view.
addListener
chrome.app.runtime.onEmbedRequested.addListener(function callback)
Parameters | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
function | callback |
The callback parameter should be a function that looks like this: function(object request) {...};
|
onLaunched
Fired when an app is launched from the launcher.
addListener
chrome.app.runtime.onLaunched.addListener(function callback)
Parameters | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
function | callback |
The callback parameter should be a function that looks like this: function(object launchData) {...};
|
onRestarted
Fired at Chrome startup to apps that were running when Chrome last shut down, or when apps have been requested to restart from their previous state for other reasons (e.g. when the user revokes access to an app's retained files the runtime will restart the app). In these situations if apps do not have an onRestarted
handler they will be sent an onLaunched
event instead.
addListener
chrome.app.runtime.onRestarted.addListener(function callback)
Parameters | ||
---|---|---|
function | callback |
The callback parameter should be a function that looks like this: function() {...};
|