aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/bg_utils.coffee5
1 files changed, 5 insertions, 0 deletions
diff --git a/background_scripts/bg_utils.coffee b/background_scripts/bg_utils.coffee
index 96c1282a..ca042686 100644
--- a/background_scripts/bg_utils.coffee
+++ b/background_scripts/bg_utils.coffee
@@ -18,6 +18,11 @@ class TabRecency
@deregister removedTabId
@register addedTabId
+ chrome.windows.onFocusChanged.addListener (wnd) =>
+ if wnd != chrome.windows.WINDOW_ID_NONE
+ chrome.tabs.query {windowId: wnd, active: true}, (tabs) =>
+ @register tabs[0].id if tabs[0]
+
register: (tabId) ->
currentTime = new Date()
# Register tabId if it has been visited for at least @timeDelta ms. Tabs which are visited only for a