diff --git a/background.js b/background.js index 8f65e64..3262280 100644 --- a/background.js +++ b/background.js @@ -11,6 +11,9 @@ function bufferOrForward(message, sender) { if (!data[tabId] || message === 'refresh') { resetState(tabId); + + // TODO: this is kind of a hack-y spot to put this + showPageAction(tabId); } // TODO: not sure how I feel about special-casing `refresh` @@ -97,3 +100,12 @@ chrome.tabs.onRemoved.addListener(function (tabId) { delete data[tabId]; } }); + + +function showPageAction(tabId) { + chrome.pageAction.show(tabId); + chrome.pageAction.setTitle({ + tabId: tabId, + title: 'Batarang Active' + }); +} diff --git a/img/icon19.png b/img/icon19.png new file mode 100644 index 0000000..fbd2de6 Binary files /dev/null and b/img/icon19.png differ diff --git a/img/icon38.png b/img/icon38.png new file mode 100644 index 0000000..6bec1c6 Binary files /dev/null and b/img/icon38.png differ diff --git a/manifest.json b/manifest.json index bb2809f..474b359 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,7 @@ "tabs", "" ], + "content_scripts": [ { "matches": [""], @@ -15,11 +16,22 @@ "run_at": "document_start" } ], + "background": { "scripts": [ "background.js" ] }, + + "page_action": { + "default_icon": { + "19": "img/icon19.png", + "38": "img/icon38.png" + }, + + "default_title": "AngularJS Super-Powered" + }, + "web_accessible_resources": [ "dist/hint.js" ],