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:
@@ -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();
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user