Greasy Fork is available in English.
点击页面右侧下方空白处快速返回顶部
当前为
// ==UserScript==
// @name gushiwen enhanced
// @name:zh-CN gushiwen增强
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 点击页面右侧下方空白处快速返回顶部
// @author Hulu
// @match *://so.gushiwen.cn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gushiwen.cn
// @grant none
// @license GPL-3.0 License
// @run-at document-end
// ==/UserScript==
// 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处)
function backToTop(selectors) {
document.querySelector(selectors).oncontextmenu = function(event){
if (event.target == this) {
event.preventDefault();
window.scrollTo(0,0)
}
}
}
(function() {
'use strict';
backToTop('.main3');
// Your code here...
})();