mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-12 20:51:25 +02:00
remove default replacing for new tab and make it optional.
This commit is contained in:
22
src/eventPage.js
Normal file
22
src/eventPage.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
chrome.tabs.onCreated.addListener(function (tab) {
|
||||||
|
|
||||||
|
console.log('created', arguments)
|
||||||
|
if (tab.url === 'chrome://newtab/') {
|
||||||
|
chrome.tabs.update(tab.id, {
|
||||||
|
url: chrome.extension.getURL('index.html')
|
||||||
|
}, function callback() {
|
||||||
|
console.log('ho gaya');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.tabs.onUpdated.addListener(function () {
|
||||||
|
|
||||||
|
console.log('updated', arguments)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.browserAction.onClicked.addListener(function(activeTab) {
|
||||||
|
chrome.tabs.create({ url: chrome.extension.getURL('index.html'), selected: true });
|
||||||
|
});
|
@ -3,13 +3,19 @@
|
|||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "Convert new tabs into an offline playground for your web experiments",
|
"description": "Convert new tabs into an offline playground for your web experiments",
|
||||||
"chrome_url_overrides" : {
|
|
||||||
"newtab": "index.html"
|
|
||||||
},
|
|
||||||
"homepage_url": "https://kushagragour.in/lab/web-maker",
|
"homepage_url": "https://kushagragour.in/lab/web-maker",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage"
|
"storage",
|
||||||
|
"tabs"
|
||||||
],
|
],
|
||||||
|
"browser_action": {
|
||||||
|
"default_title": "Start Web Maker",
|
||||||
|
"default_icon": "icon-16.png"
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"scripts": [ "eventPage.js" ],
|
||||||
|
"persistent": false
|
||||||
|
},
|
||||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icon-16.png",
|
"16": "icon-16.png",
|
||||||
|
Reference in New Issue
Block a user