I discovered a wonderful comic named Stand Still. Stay Silent
I wanted to add the possiblity to use the arrow keys to browse the web comic, I then created a script for it :
// ==UserScript== // @name Stand Still. Stay silent Arrow Keys // @namespace http://aaflalo.me // @version 0.1 // @description Using the arrows key to navigate throught the comic // @author Antoine Aflalo // @match http://www.sssscomic.com/comic.php?page=* // @include http://www.sssscomic.com/comic.php?page=* // @updateURL https://gist.github.com/Belphemur/2920677efbfde686d0e1/raw/Stand%20Still.%20Stay%20Silent.user.js // @downloadURL https://gist.github.com/Belphemur/2920677efbfde686d0e1/raw/Stand%20Still.%20Stay%20Silent.user.js // @grant none // ==/UserScript== var basicURL = "http://www.sssscomic.com/comic.php?page="; function getComicPage () { var re = /page=(\d+)/; id = re.exec(document.location); return parseInt(id[1]); } function changePage(id) { if(id < 0) return; document.location.href = basicURL + id; } function checkKey(e) { e = e || window.event; if (e.keyCode == '37') { changePage(getComicPage() - 1); } else if (e.keyCode == '39') { changePage(getComicPage() +1); } } document.onkeydown = checkKey;
5th November 2014
Code, Scripts
js, ssss, userscript
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Notify me via e-mail if anyone answers my comment.
Δ
© 2022 Antoine Aflalo — Powered by WordPress
Theme by Anders Noren — Up ↑
Leave a Reply