Copy current url

Copy current website url by pressing yy

目前为 2025-01-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         Copy current url
// @namespace    https://gf.qytechs.cn/en/users/901750-gooseob
// @version      1.0.0
// @description  Copy current website url by pressing yy
// @author       GooseOb
// @license      MIT
// @match        *
// ==/UserScript==

(function () {
  let isPressed = false;
  document.addEventListener("keyup", function (e) {
    if (e.key === "y") {
      if (isPressed) {
        navigator.clipboard.writeText(window.location.href);
        isPressed = false;
      } else {
        isPressed = true;
        setTimeout(() => {
          isPressed = false;
        }, 1000);
      }
    }
  });
})();

QingJ © 2025

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