Skip to content

Instantly share code, notes, and snippets.

@Kurotaku-sama
Last active March 27, 2025 16:50
Show Gist options
  • Save Kurotaku-sama/4271cc2de480168c0ada068258ee956e to your computer and use it in GitHub Desktop.
Save Kurotaku-sama/4271cc2de480168c0ada068258ee956e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name z0r Controls
// @namespace https://kurotaku.de
// @version 1.0
// @description Use A & D or Left & Right arrows to navigate posts. Press Space to open comments
// @author Kurotaku
// @license CC BY-NC-SA 4.0
// @match https://z0r.de/*
// @icon https://www.google.com/s2/favicons?domain=z0r.de
// @updateURL https://gist.github.com/Kurotaku-sama/4271cc2de480168c0ada068258ee956e/raw/z0r%2520Controls.user.js
// @downloadURL https://gist.github.com/Kurotaku-sama/4271cc2de480168c0ada068258ee956e/raw/z0r%2520Controls.user.js
// @require https://gist.github.com/Kurotaku-sama/1a7dcb227ce3d7a1b596afe725c0052a/raw/kuros_library.js
// @require https://cdn.jsdelivr.net/npm/sweetalert2
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @grant GM_registerMenuCommand
// ==/UserScript==
let disqus_open = false;
(function() {
document.onkeydown = check_key;
})();
function check_key(e) {
e = e || window.event;
let kc = e.keyCode;
let unten = document.getElementById("unten");
let prev = unten.getElementsByTagName("a")[0];
let next = unten.getElementsByTagName("a")[2];
if (kc == "37" || kc == "65")
prev.click();
else if (kc == "39" || kc == "68")
next.click();
else if (kc == "32" && !disqus_open) {
disqus_open = true;
document.getElementById("disqus_button").click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment