Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chime Keyboard shortcuts
// ==UserScript==
// @name Chime Keyboard Shortcuts
// @namespace http://app.chime.aws
// @version 0.1
// @description Simple keyboard shortcuts for chime
// @author justinleegarrison@gmail.com
// @match https://app.chime.aws/meetings/*
// @grant none
// @run-at document-end
// ==/UserScript==
// 'm' = mute voice
// 'v' = mute face
(function() {
'use strict';
document.addEventListener('keydown', function(e) {
if( e.target.className === "notranslate public-DraftEditor-content" ) return;
console.log(e);
if (e.key == "m" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var unmuteButton = document.querySelector(".MeetingControlButton--micMuted");
var muteButton = document.querySelector(".MeetingControlButton--micActive");
if (unmuteButton !== null) {
unmuteButton.click();
} else {
muteButton.click();
}
} else if (e.key == "v" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var faceMuteButton = document.querySelector(".MeetingControlButton--localVideoMuted");
var faceUnmuteButton = document.querySelector(".MeetingControlButton--localVideoActive");
if (faceUnmuteButton !== null) {
faceUnmuteButton.click();
} else {
faceMuteButton.click();
}
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment