Allows arrow key navigation between chapters (left = prev/right = next) & allows reizing of chapter images when you press the up arrow key.
当前为
// ==UserScript==
// @name MangaNelo Scripts (Next/Prev Chapter & Image Resize)
// @namespace ew0345
// @match *://manganelo.com/chapter/*/*
// @grant none
// @version 1.0
// @author ew0345
// @description Allows arrow key navigation between chapters (left = prev/right = next) & allows reizing of chapter images when you press the up arrow key.
// ==/UserScript==
var img = ['.container-chapter-reader img'];
var wper = 100;
function setImageWidth() {
var inp = prompt('Image Width % (Do not include % sign)');
wper = inp.valueOf();
for (var i = 0; i < document.querySelectorAll(img).length; i++) {
document.querySelectorAll(img)[i].style.width = wper+'%';
}
}
window.onkeydown = function(e) {
switch (e.key) {
case "ArrowLeft":
$('a:contains("PREV CHAPTER")').length > 0 ? document.location = $('a:contains("PREV CHAPTER")').attr('href') : console.error('no previous chapter');
break;
case "ArrowRight":
$('a:contains("NEXT CHAPTER")').length > 0 ? document.location = $('a:contains("NEXT CHAPTER")').attr('href') : console.error('no next chapter');
break;
case "ArrowUp":
setImageWidth();
break;
default: break;
}
}