Created
February 24, 2024 20:57
-
-
Save nikhilweee/95090490e98f51f3d4227a80de57e848 to your computer and use it in GitHub Desktop.
Instagram Web Keyboard Shortcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('keydown', function(event) { | |
// Map the "." key with previous image in post. | |
if (event.keyCode === 188) { | |
let backButton = document.querySelector('button[aria-label="Go back"]'); | |
if (backButton) { | |
backButton.click(); | |
} | |
} | |
// Map the "," key with next image in post. | |
else if (event.keyCode === 190) { | |
let nextButton = document.querySelector('button[aria-label="Next"]'); | |
if (nextButton) { | |
nextButton.click(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment