From 905fc2d147d1bc656c9e9fec74cda364a686d638 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 8 Feb 2017 17:42:25 +0000 Subject: Fallback to storage.local if storage.sync is not available --- background_scripts/marks.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee index 33c467a7..a6491b9e 100644 --- a/background_scripts/marks.coffee +++ b/background_scripts/marks.coffee @@ -30,7 +30,7 @@ Marks = saveMark: (markInfo) -> item = {} item[@getLocationKey markInfo.markName] = markInfo - chrome.storage.sync.set item + Settings.storage.set item # Goto a global mark. We try to find the original tab. If we can't find that, then we try to find another # tab with the original URL, and use that. And if we can't find such an existing tab, then we create a new @@ -39,7 +39,7 @@ Marks = chrome.storage.local.get "vimiumSecret", (items) => vimiumSecret = items.vimiumSecret key = @getLocationKey req.markName - chrome.storage.sync.get key, (items) => + Settings.storage.get key, (items) => markInfo = items[key] if markInfo.vimiumSecret != vimiumSecret # This is a different Vimium instantiation, so markInfo.tabId is definitely out of date. -- cgit v1.2.3 From 1d9a5b4935d6cab867ab44d0d8265738c37ce988 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 8 Feb 2017 18:19:03 +0000 Subject: Workaround type error for unsupported openerTabId in FF --- background_scripts/main.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 70739eae..4fb754f8 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -101,8 +101,13 @@ TabOperations = index: request.tab.index + 1 active: true windowId: request.tab.windowId - openerTabId: request.tab.id - chrome.tabs.create tabConfig, callback + chrome.tabs.create tabConfig, (tab) -> + # NOTE(mrmr1993, 2017-02-08): Firefox currently doesn't support openerTabId (issue 1238314) and throws + # a type error if it is present. We work around this by attempting to set it separately from creating + # the tab. + try chrome.tabs.update tab.id, { openerTabId : request.tab.id }, callback + catch + callback.apply this, arguments toggleMuteTab = do -> muteTab = (tab) -> chrome.tabs.update tab.id, {muted: !tab.mutedInfo.muted} -- cgit v1.2.3