您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
rfc page turning key: ← →
// ==UserScript== // @name rfc page turning key // @namespace http://note.yurenchen.com/archives/js_snippets.html // @version 0.1 // @description rfc page turning key: ← → // @author yurenchen // @match https://tools.ietf.org/html/* // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; //rfc page turning key: ← → var pages = document.getElementsByClassName('newpage'); var page_height = pages[1].offsetTop-pages[0].offsetTop; console.log('page_height"', page_height); function nextpage(){ document.body.scrollTop += page_height; } function prevpage(){ document.body.scrollTop -= page_height; } document.body.onkeydown = function(e){ console.log('onkeydown:',e); switch(e.key){ case 'ArrowRight': nextpage(); break; case 'ArrowLeft': prevpage(); break; } }; })();