Skip to content

Commit

Permalink
select active tab in active window & add event listener onFocusChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrion committed Jun 27, 2016
1 parent 2b6e55f commit 53aad2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ chrome.tabs.onActivated.addListener(function(activeInfo) {
});

chrome.tabs.onUpdated.addListener(function() {
chrome.tabs.query({active: true}, function(tabs) {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
checkHonCode(tabs[0].url);
});
});

chrome.windows.onFocusChanged.addListener(function() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
checkHonCode(tabs[0].url);
});
});
Expand Down

0 comments on commit 53aad2d

Please sign in to comment.