Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 723
E_bme Avatar asked Apr 14 '16 00:04

E_bme


1 Answers

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

like image 170
Daniel Herr Avatar answered Sep 28 '22 07:09

Daniel Herr