Skip to content

Commit

Permalink
Switched to an event page
Browse files Browse the repository at this point in the history
so Chrome can unload the background page if it's unused.
  • Loading branch information
mac-cain13 committed Nov 10, 2013
1 parent e182132 commit bd9ffb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/manifest.json
Expand Up @@ -25,7 +25,8 @@
"matches": [ "*://*/*" ]
} ],
"background": {
"scripts": [ "background.js" ]
"scripts": [ "background.js" ],
"persistent": false
},

"commands": {
Expand Down
6 changes: 4 additions & 2 deletions source/popup.js
Expand Up @@ -41,8 +41,10 @@ $(function() {
function(response)
{
// Make the backgroundpage update the icon and close the popup
chrome.runtime.getBackgroundPage().updateIcon(response.status, tabs[0].id);
window.close();
chrome.runtime.getBackgroundPage(function(backgroundPage) {
backgroundPage.updateIcon(response.status, tabs[0].id);
window.close();
});
}
);
});
Expand Down

0 comments on commit bd9ffb1

Please sign in to comment.