Skip to content

Instantly share code, notes, and snippets.

@iurev
Created October 8, 2024 13:21
Show Gist options
  • Save iurev/4a9260800072d6e6b0cd4066c01a26ee to your computer and use it in GitHub Desktop.
Save iurev/4a9260800072d6e6b0cd4066c01a26ee to your computer and use it in GitHub Desktop.
document.addEventListener('keydown', function(event) {
// Check if Ctrl+Y is pressed
if (event.ctrlKey && event.key === 'y') {
event.preventDefault(); // Prevent the default browser behavior
// Find the element with data-element-id="voice-input-button"
var voiceInputButton = document.querySelector('[data-element-id="voice-input-button"]');
// If the element exists, click it
if (voiceInputButton) {
voiceInputButton.click();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment