aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/bg_utils.coffee2
-rw-r--r--background_scripts/main.coffee6
-rw-r--r--background_scripts/marks.coffee6
-rw-r--r--pages/options.html3
4 files changed, 11 insertions, 6 deletions
diff --git a/background_scripts/bg_utils.coffee b/background_scripts/bg_utils.coffee
index b8e618ff..698f5352 100644
--- a/background_scripts/bg_utils.coffee
+++ b/background_scripts/bg_utils.coffee
@@ -18,7 +18,7 @@ class TabRecency
@deregister removedTabId
@register addedTabId
- chrome.windows.onFocusChanged.addListener (wnd) =>
+ 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]
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 97d8fa65..725766e6 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -148,7 +148,7 @@ toggleMuteTab = do ->
#
selectSpecificTab = (request) ->
chrome.tabs.get(request.id, (tab) ->
- chrome.windows.update(tab.windowId, { focused: true })
+ chrome.windows?.update(tab.windowId, { focused: true })
chrome.tabs.update(request.id, { active: true }))
moveTab = ({count, tab, registryEntry}) ->
@@ -324,7 +324,7 @@ Frames =
enabledState = Exclusions.isEnabledForUrl request.url
if request.frameIsFocused
- chrome.browserAction.setIcon tabId: tabId, imageData: do ->
+ chrome.browserAction.setIcon? tabId: tabId, imageData: do ->
enabledStateIcon =
if not enabledState.isEnabledForUrl
DISABLED_ICON
@@ -449,7 +449,7 @@ chrome.tabs.onRemoved.addListener (tabId) ->
delete cache[tabId] for cache in [frameIdsForTab, urlForTab, portsForTab, HintCoordinator.tabState]
chrome.storage.local.get "findModeRawQueryListIncognito", (items) ->
if items.findModeRawQueryListIncognito
- chrome.windows.getAll null, (windows) ->
+ chrome.windows?.getAll null, (windows) ->
for window in windows
return if window.incognito
# There are no remaining incognito-mode tabs, and findModeRawQueryListIncognito is set.
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
diff --git a/pages/options.html b/pages/options.html
index bfdb9b53..7ab8886b 100644
--- a/pages/options.html
+++ b/pages/options.html
@@ -325,6 +325,7 @@ b: http://b.com/?q=%s description
<td>
<div class="help">
<div class="example">
+ Click to backup your settings, or right-click and select <i>Save As</i>.
</div>
</div>
<a id="backupLink" download="vimium-options.json">Click to download backup</a>
@@ -335,7 +336,7 @@ b: http://b.com/?q=%s description
<td>
<div class="help">
<div class="example">
- Choose file, then click <i>Save Changes</i>, below, to confirm restore.
+ Choose a backup file to restore, then click <i>Save Changes</i>, below, to confirm.
</div>
</div>
<input id="chooseFile" type="file" accept=".json" style="width: 200px;"/>