How can Chrome extension get a callback when the browser starts?

google-chrome, google-chrome-extension

Solution

if you want the tab to open when Chrome is started up, you can just include the code: `chrome.tabs.create({url:"someUrl"});` in your background.js file or if you want it to open everytime a new window opens, you can include the previous code plus an extra event listener to the new window event like this:

chrome.windows.onCreated.addListener(function() {
chrome.tabs.create({url:"someUrl"});
})

Problem

I need a way in my Chrome extension to know when the browser is starting up, so that it can automatically open an html page. Is there a mechanism in Chrome extension API that can get me this facility? I need this functionality for a personal extension of mine, that I use only on my computer. So it's ok if this can be accomplished through a hack. My extension would like to know when the browser has started. Any ideas?

Original source