Skip to content

Instantly share code, notes, and snippets.

@JulianWebb
Created October 30, 2019 11:16
Show Gist options
  • Save JulianWebb/7560331fa503b784be8a26d5cfd974f4 to your computer and use it in GitHub Desktop.
Save JulianWebb/7560331fa503b784be8a26d5cfd974f4 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name El Goonish Shive Arrow Keys
// @namespace https://gist.github.com/JulianWebb
// @version 0.1
// @author Pongles
// @description Adds the ability to navigate the comic using just the left and right arrow keys
// @icon https://egscomics.com/favicon.ico
// @match https://egscomics.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log('Check, Please! Arrow Keys is working!')
document.onkeydown = function(e) {
switch (e.key) {
case 'ArrowLeft':
let prevPage = document.querySelector(".cc-prev");
prevPage.click()
break;
case 'ArrowRight':
let nextPage = document.querySelector(".cc-next");
nextPage.click();
break;
default: return;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment