1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-15 19:16:18 +02:00
Files
php-web-maker/src/eventPage.js
2016-06-30 04:08:06 +05:30

25 lines
648 B
JavaScript

chrome.browserAction.onClicked.addListener(function(){
chrome.tabs.create({
url: chrome.extension.getURL('index.html'),
selected: true
});
});
// Listen for tabs getting created.
chrome.tabs.onCreated.addListener(function (tab) {
// If a new tab is opened (without any URL), check user's
// replace Tab setting and act accordingly.
if (tab.url === 'chrome://newtab/') {
chrome.storage.sync.get({
replaceNewTab: true
}, function(items) {
if (items.replaceNewTab) {
chrome.tabs.update(tab.id, {
url: chrome.extension.getURL('index.html')
}, function callback() {
console.log('ho gaya');
});
}
});
}
});