您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Select to copy and use in the browser.
// ==UserScript== // @name select-to-copy // @namespace https://github.com/wChenonly/select-to-copy // @version 0.0.6 // @author wChenonly // @description Select to copy and use in the browser. // @license MIT // @homepage https://github.com/wChenonly/select-to-copy#readme // @homepageURL https://github.com/wChenonly/select-to-copy#readme // @source https://github.com/wChenonly/select-to-copy.git // @supportURL https://github.com/wChenonly/select-to-copy/issues // @include *://**/* // @grant unsafeWindow // ==/UserScript== (function () { 'use strict'; var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)(); let text; const body = document.querySelector("body"); body == null ? void 0 : body.addEventListener("mouseup", (e) => { var _a; if (((_a = e.target) == null ? void 0 : _a.isContentEditable) || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) { return; } if (_unsafeWindow.getSelection) { text = _unsafeWindow.getSelection(); } else if (document.getSelection) { text = document.getSelection(); } const v = text == null ? void 0 : text.toString(); v && navigator.clipboard.writeText(v); }); })();