diff --git a/background.js b/background.js index f6409fb..531ac68 100644 --- a/background.js +++ b/background.js @@ -49,14 +49,24 @@ browser.webRequest.onHeadersReceived.addListener( function handleMessage(request, sender, sendResponse) { + browser.storage.sync.get({orangeIcon: false}).then(function(options){ - let popup = new URL(browser.runtime.getURL('popup/popup.html')); - popup.searchParams.set('feeds', JSON.stringify(request)); + let popup = new URL(browser.runtime.getURL('popup/popup.html')); + popup.searchParams.set('feeds', JSON.stringify(request)); - browser.pageAction.setPopup( {tabId: sender.tab.id, popup: popup.toString() }); - browser.pageAction.show(sender.tab.id); + if (options.orangeIcon) { + browser.pageAction.setIcon({tabId: sender.tab.id, path: { + "19": "icons/rss-19.png", + "38": "icons/rss-38.png" + } + }); + } + browser.pageAction.setPopup( {tabId: sender.tab.id, popup: popup.toString() }); + browser.pageAction.show(sender.tab.id); - //sendResponse({response: "Response from background script to tab " + sender.tab.url , id: sender.tab.id }); + //sendResponse({response: "Response from background script to tab " + sender.tab.url , id: sender.tab.id }); + + }); } browser.runtime.onMessage.addListener(handleMessage); diff --git a/icons/rss-19.png b/icons/rss-19.png new file mode 100644 index 0000000..277e422 Binary files /dev/null and b/icons/rss-19.png differ diff --git a/icons/rss-38.png b/icons/rss-38.png new file mode 100644 index 0000000..a5f9739 Binary files /dev/null and b/icons/rss-38.png differ diff --git a/settings/options.html b/settings/options.html index 694e201..ba5c5ed 100644 --- a/settings/options.html +++ b/settings/options.html @@ -15,6 +15,8 @@