Skip to content

Commit

Permalink
feat(pageAction): show page action when instrumentation is active
Browse files Browse the repository at this point in the history
  • Loading branch information
btford committed Dec 22, 2014
1 parent 68b72bf commit a219e1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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 added img/icon19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icon38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@
"tabs",
"<all_urls>"
],

"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["inject.js"],
"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"
],
Expand Down

0 comments on commit a219e1c

Please sign in to comment.