aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/bg_utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-02-20 17:23:48 +0000
committerStephen Blott2016-02-20 17:23:48 +0000
commitf435bb93aaa91228b1cac7c92cc2995bbf88257f (patch)
treeae34f39490f1e631dbb015d5a873207b8f91f3dd /background_scripts/bg_utils.coffee
parent0a6fb464f44bc4db242183ad137e9f80f793ec62 (diff)
parent041b441073be2a554af94b23ea16535391cc1f29 (diff)
downloadvimium-f435bb93aaa91228b1cac7c92cc2995bbf88257f.tar.bz2
Merge branch 'windows-onFocusChanged'
Diffstat (limited to 'background_scripts/bg_utils.coffee')
-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