Skip to content

Instantly share code, notes, and snippets.

@CXuesong
Last active June 23, 2017 14:19
Show Gist options
  • Save CXuesong/27ff62fef5456dfbebd00a02b5546fa5 to your computer and use it in GitHub Desktop.
Save CXuesong/27ff62fef5456dfbebd00a02b5546fa5 to your computer and use it in GitHub Desktop.
Makes SSSS web-comic more accessible to PC users. (Plus aRTD now.) See {README}.md below for setup instructions.
// ==UserScript==
// @name SSSS Helper
// @namespace http://cxuesong.com/
// @version 0.2.0
// @updateURL https://gist.githubusercontent.com/CXuesong/27ff62fef5456dfbebd00a02b5546fa5/raw/SSSS%20Helper.js
// @homepage https://gist.github.com/CXuesong/27ff62fef5456dfbebd00a02b5546fa5#file-readme-md
// @description Makes SSSS web-comic more accessible to PC users. (Plus aRTD now.)
// @author CXuesong
// @match http://sssscomic.com/comic.php*
// @match http://www.minnasundberg.fi/comic/page*
// @match http://www.minnasundberg.fi/comic/sivu*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
var prevUrl = $("#navprev2b").parent().attr("href") || $('img[src*="aprev.jpg"]').parent().attr("href");
var nextUrl = $("#navnext2b").parent().attr("href") || $('img[src*="anext.jpg"]').parent().attr("href");
console.log("PrevUrl: %s, NextUrl: %s", prevUrl, nextUrl);
$("body").keydown(function (e) {
var keyCode = e.which || e.keyCode;
if (keyCode == 37)
{
if (prevUrl)
{
if ($("body").scrollLeft() === 0)
window.open(prevUrl, "_self");
}
} else if (keyCode == 39) {
if (nextUrl)
{
var fullWidth = $("body").prop("scrollWidth");
if (!fullWidth || $("body").innerWidth() + $("body").scrollLeft() === fullWidth)
window.open(nextUrl, "_self");
}
}
});
})();

0.2.0

  • The script now supports keyboard navigation on A Readtail's Dream.
  • Keyboard navigation now only takes place when you've scrolled the page to the leftmost/rightmost.

This Tampermokey script allows you to navigate through Stand Still, Stay Silent webcomic by using Left/Rgiht Arrow Keys.

To apply this scriptlet, you need to install Tampermonkey plugin for your browser first; then simply go to its dashboard, switch to "Utility" tab, fill in the following address to the URL box

https://gist.githubusercontent.com/CXuesong/27ff62fef5456dfbebd00a02b5546fa5/raw/SSSS%20Helper.js

and click "Import" button. You may try it out; happy reading!

p.s.

I've only tested the script on Chrome. If you come across bugs on other browsers, please leave me a comment. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment