From c87aee8bb998531023f78e6bbb4101ab7b7ca4c4 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Thu, 30 Jun 2016 03:51:36 +0530 Subject: [PATCH] Revert "remove tab permission." This reverts commit c1ef1064698acf7b91d460ff7b9a2ea5529f5574. Conflicts: src/eventPage.js src/manifest.json --- src/eventPage.js | 15 +++++++++++++++ src/manifest.json | 8 +++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/eventPage.js b/src/eventPage.js index 672761e..f6c543c 100644 --- a/src/eventPage.js +++ b/src/eventPage.js @@ -3,4 +3,19 @@ chrome.browserAction.onClicked.addListener(function(){ url: chrome.extension.getURL('index.html'), selected: true }); +}); + +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) }); \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 846f52d..c34c6dc 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -5,17 +5,15 @@ "description": "Convert new tabs into an offline playground for your web experiments", "homepage_url": "https://kushagragour.in/lab/web-maker", "permissions": [ - "storage" + "storage", + "tabs" ], - "chrome_url_overrides" : { - "newtab": "index.html" - }, "options_ui": { "page": "options.html", "chrome_style": true }, "browser_action": { - "default_title": "Web Maker", + "default_title": "Start Web Maker", "default_icon": "icon-16.png" }, "background": {