任何网站双击shift回到页面顶部

叮~

// ==UserScript==
// @name         任何网站双击shift回到页面顶部
// @namespace    ding
// @version      0.1
// @description  叮~
// @author       jackpapapapa
// @include        *
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mozilla.org
// @license      MIT
// ==/UserScript==

      ;(function () {
        let start = 0
        let end = 0
        let count = 0
        document.addEventListener("keydown", (e) => {
          if (e.shiftKey) {
            if (count === 0) start = new Date().getTime()
            count++
          }
          if (count === 2) {
            end = new Date().getTime()
            if (end - start <= 600) {
              document.scrollingElement.scrollTop = 0
            }
            count = 0
          }
        })
      })()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址