Reputation: 89
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
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