Created
October 30, 2019 11:16
-
-
Save JulianWebb/7560331fa503b784be8a26d5cfd974f4 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
// ==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