1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-02 19:37:29 +02:00

open the extension page on first install.

This commit is contained in:
Kushagra Gour
2016-12-28 16:35:20 +05:30
parent 1d2bd36977
commit 669bfe14ae

View File

@@ -1,8 +1,12 @@
chrome.browserAction.onClicked.addListener(function(){
function openApp() {
chrome.tabs.create({
url: chrome.extension.getURL('index.html'),
selected: true
});
}
chrome.browserAction.onClicked.addListener(function(){
openApp();
});
// Listen for tabs getting created.
@@ -22,4 +26,10 @@ chrome.tabs.onCreated.addListener(function (tab) {
}
});
}
});
chrome.runtime.onInstalled.addListener(function callback (details) {
if (details.reason === 'install') {
openApp();
}
});