feat(pageAction): show page action when instrumentation is active

Closes #199
master
Brian Ford 9 years ago
parent 68b72bfa6f
commit a219e1cdd3

@ -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'
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -8,6 +8,7 @@
"tabs",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"],
@ -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"
],