Greasy Fork is available in English.
A simple script that allows you to use the left and right arrow keys to navigate chapters at mtlnovel.com
当前为
// ==UserScript==
// @name MTL Novel Arrow Key Nav
// @namespace GF-Fear3d
// @version 0.8
// @description A simple script that allows you to use the left and right arrow keys to navigate chapters at mtlnovel.com
// @author Fear3d
// @match https://www.mtlnovel.com/*/*/
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
var nextUrl = "";
var prevUrl = "";
// Find URLs for Next and Prev
$(document).ready(function() {
var nextPage = $("a.next:first");
var prevPage = $("a.prev:first");
nextUrl = nextPage.attr("href");
prevUrl = prevPage.attr("href");
});
// Handle arrow key events
$(document).ready(function() {
document.onkeydown = function(evt) {
switch (evt.keyCode) {
case 37: // Left Arrow
window.location = prevUrl;
break;
case 39: // Right Arrow
window.location = nextUrl;
break;
}
};
});
// Some Costmetic fixes in this function
$(document).ready(function() {
// Changes color of donation banner in night mode and replaces ko-fi image
if ($("body.nightmode-on").length) {
$("div.donations").css("background-color", "#1f2129");
$(".donations > p:nth-child(2) > a:nth-child(1) > amp-img:nth-child(1)").attr("src", "https://i.imgur.com/3rT5sKF.png");
$(".donations > p:nth-child(2) > a:nth-child(1) > amp-img:nth-child(1) > amp-img:nth-child(1)").attr("src",
"https://i.imgur.com/3rT5sKF.png");
$("img.i-amphtml-fill-content:nth-child(2)").attr("src", "https://i.imgur.com/3rT5sKF.png");
}
// Hides blank space in middle of chapter (probably caused by one of MTLNovel's ad scripts that my adblocker is blocking)
$("#mgid-under").hide();
});
})();