aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/marks.coffee
diff options
context:
space:
mode:
authorStephen Blott2017-10-29 14:50:07 +0000
committerGitHub2017-10-29 14:50:07 +0000
commit0c58201095059edd7b8b6e7e76792376c4bd8b3d (patch)
treedec1ea7a531efc6dbee4217a14b4f1d8a2f92cd7 /background_scripts/marks.coffee
parent9d5227399acba98a99830e55cbcc1ebbb6ee4b54 (diff)
parentdd961bbff7ae6d7474fe1455a6999c66f77b1cb4 (diff)
downloadvimium-0c58201095059edd7b8b6e7e76792376c4bd8b3d.tar.bz2
Merge pull request #2733 from mrmr1993/ff-android
Minimal Firefox Android support
Diffstat (limited to 'background_scripts/marks.coffee')
-rw-r--r--background_scripts/marks.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee
index a6491b9e..77b07b41 100644
--- a/background_scripts/marks.coffee
+++ b/background_scripts/marks.coffee
@@ -82,7 +82,7 @@ Marks =
# Given a list of tabs candidate tabs, pick one. Prefer tabs in the current window and tabs with shorter
# (matching) URLs.
pickTab: (tabs, callback) ->
- chrome.windows.getCurrent ({ id }) ->
+ tabPicker = ({ id }) ->
# Prefer tabs in the current window, if there are any.
tabsInWindow = tabs.filter (tab) -> tab.windowId == id
tabs = tabsInWindow if 0 < tabsInWindow.length
@@ -92,6 +92,10 @@ Marks =
# Prefer shorter URLs.
tabs.sort (a,b) -> a.url.length - b.url.length
callback tabs[0]
+ if chrome.windows?
+ chrome.windows.getCurrent tabPicker
+ else
+ tabPicker({id: undefined})
root = exports ? window
root.Marks = Marks