<p>I discovered a wonderful comic named <a title="Stand Still. Stay Silent" href="http://www.sssscomic.com/">Stand Still. Stay Silent</a></p>
<p>I wanted to add the possiblity to use the arrow keys to browse the web comic, I then created a script for it :</p>
<p><span id="more-170"></span></p>
<script src="https://gist.github.com/2920677efbfde686d0e1.js"></script><noscript><pre><code class="language-javascript javascript">// ==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 == &#039;37&#039;) {
 changePage(getComicPage() - 1);
 }
 else if (e.keyCode == &#039;39&#039;) {
 changePage(getComicPage() +1);
 }
}

document.onkeydown = checkKey;
</code></pre></noscript>

Leave a Reply Cancel reply