aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2017-04-18 05:47:15 +0100
committerGitHub2017-04-18 05:47:15 +0100
commit8058a54fd5a6a2f0e1a62a3a66f837a07045396e (patch)
treea7e0949cd41b8fa8d03fa27140f8b815ec1d64c4 /background_scripts/main.coffee
parent84723d7561d0cc12f54a6d388dcd505ddd6105ac (diff)
parentb0fc681480da40ec0bdb43773275ef7181c78cf1 (diff)
downloadvimium-8058a54fd5a6a2f0e1a62a3a66f837a07045396e.tar.bz2
Merge pull request #2476 from mrmr1993/firefox
Improve firefox support
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee9
1 files changed, 7 insertions, 2 deletions
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}