aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/commands.coffee9
-rw-r--r--background_scripts/main.coffee1
2 files changed, 7 insertions, 3 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index c334cf9d..e905c410 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -41,7 +41,7 @@ Commands =
# them you have to press "shift" as well.
normalizeKey: (key) ->
key.replace(/<[acm]-/ig, (match) -> match.toLowerCase())
- .replace(/<([acm]-)?([a-zA-Z0-9]{2,5})>/g, (match, optionalPrefix, keyName) ->
+ .replace(/<([acm]-)?([a-zA-Z0-9]{2,})>/g, (match, optionalPrefix, keyName) ->
"<" + (if optionalPrefix then optionalPrefix else "") + keyName.toLowerCase() + ">")
parseCustomKeyMappings: (customKeyMappings) ->
@@ -97,7 +97,7 @@ Commands =
# Keys are either literal characters, or "named" - for example <a-b> (alt+b), <left> (left arrow) or <f12>
# This regular expression captures two groups: the first is a named key, the second is the remainder of
# the string.
- namedKeyRegex = /^(<(?:[amc]-.|(?:[amc]-)?[a-z0-9]{2,5})>)(.*)$/
+ namedKeyRegex = /^(<(?:[amc]-.|(?:[amc]-)?[a-z0-9]{2,})>)(.*)$/
keyStateMapping = {}
for own keys, registryEntry of @keyToCommandRegistry
currentMapping = keyStateMapping
@@ -171,6 +171,7 @@ Commands =
"lastTab",
"duplicateTab",
"togglePinTab",
+ "toggleMuteTab",
"removeTab",
"restoreTab",
"moveTabToNewWindow",
@@ -273,6 +274,7 @@ defaultKeyMappings =
"X": "restoreTab"
"<a-p>": "togglePinTab"
+ "<a-m>": "toggleMuteTab"
"o": "Vomnibar.activate"
"O": "Vomnibar.activateInNewTab"
@@ -362,7 +364,8 @@ commandDescriptions =
restoreTab: ["Restore closed tab", { background: true, repeatLimit: 20 }]
moveTabToNewWindow: ["Move tab to new window", { background: true }]
- togglePinTab: ["Pin/unpin current tab", { background: true, noRepeat: true }]
+ togglePinTab: ["Pin or unpin current tab", { background: true, noRepeat: true }]
+ toggleMuteTab: ["Mute or unmute current tab", { background: true, noRepeat: true }]
closeTabsOnLeft: ["Close tabs on the left", {background: true, noRepeat: true}]
closeTabsOnRight: ["Close tabs on the right", {background: true, noRepeat: true}]
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 929d5537..d9b527ef 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -210,6 +210,7 @@ BackgroundCommands =
openCopiedUrlInCurrentTab: (request) -> TabOperations.openUrlInCurrentTab extend request, url: Clipboard.paste()
openCopiedUrlInNewTab: (request) -> @createTab extend request, url: Clipboard.paste()
togglePinTab: ({tab}) -> chrome.tabs.update tab.id, {pinned: !tab.pinned}
+ toggleMuteTab: ({tab}) -> chrome.tabs.update tab.id, {muted: !tab.mutedInfo.muted}
moveTabLeft: moveTab
moveTabRight: moveTab
nextFrame: ({count, frameId, tabId}) ->