Created
July 8, 2020 00:29
-
-
Save karenying/1e50d39b6914cdd0f8f7fe42ea85a9a8 to your computer and use it in GitHub Desktop.
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
const container = document.getElementsByClassName('rbGOge SeRypc'); | |
if (container) { | |
const containerChildren = container[0].childNodes; | |
const leftArrow = containerChildren[1]; | |
const rightArrow = containerChildren[2]; | |
chrome.runtime.onMessage.addListener(function (message) { | |
const { direction } = message; | |
direction === 'left' ? leftArrow.click() : rightArrow.click(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment