// ==UserScript== // @name 下一章happymh // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author wodexianghua // @match https://m.happymh.com/* // @grant none // ==/UserScript== (function () { 'use strict';
document.addEventListener('keydown', function (event) { if (document.activeElement.nodeName != 'BODY') { return; } var shang = false; var xia = false; var tf = false; var searchText; var searchText2;
if (event.keyCode == 67 || event.keyCode == 73 || event.keyCode == 39 ) {/*C c*/ xia = true; searchText = '下一章'; searchText2 = '下一页'; //此处采用数组方法访问 避免class=动态名干扰 var s2 = document.querySelector("#root > div > footer > article > p:nth-child(1) > a > span.MuiButton-label") //document.querySelector("#root > div > footer > article > p.MuiBox-root.jss119.jss115 > a") s2.click(); } else if (event.keyCode == 90 || event.keyCode == 89) {/*z Z y Y*/ window.scrollTo(0,0); }
}); // Your code here... })();
方法1 var s2 = document.querySelector("#root > div > footer > article > p:nth-child(1) > a > span.MuiButton-label") var s2 = document.querySelector("#k_next") var s2 = document.querySelector("body > div.recommendList.pagenation.clearfix > div:nth-child(2) > a") 都是简单用法
----------------------------------------------
[alias] co = clone --recurse-submodules up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/