Skip to content

Instantly share code, notes, and snippets.

@karenying
Created July 8, 2020 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karenying/1e50d39b6914cdd0f8f7fe42ea85a9a8 to your computer and use it in GitHub Desktop.
Save karenying/1e50d39b6914cdd0f8f7fe42ea85a9a8 to your computer and use it in GitHub Desktop.
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