E_bme
E_bme

Reputation: 89

Launch chrome application on startup

I would like to open a packaged chrome application automatically when the browser starts.
I have tried: chrome-extension://app id/
But it doesn't work. I get chrome-extension://invalid/ error page.

Upvotes: 6

Views: 4273

Answers (1)

Daniel Herr
Daniel Herr

Reputation: 20438

Use the chrome.runtime.onStartup event, "Fired when a profile that has this extension installed first starts up".

chrome.runtime.onStartup.addListener(function() {
 chrome.app.window.create("main.html")
})

https://developer.chrome.com/extensions/runtime#event-onStartup

Upvotes: 7

Related Questions