Greasy Fork is available in English.
快速复制鼠标选中内容
当前为
// ==UserScript==
// @name 选中复制
// @description 快速复制鼠标选中内容
// @version 1.2
// @author psrx
// @namespace https://github.com/Masotan
// @run-at document-end
// @include http://*
// @include https://*
// @include file:///*
// ==/UserScript==
;(function IIFE() {
let embed = document.querySelector('embed')
if (embed && embed.type === 'application/pdf') return
window.addEventListener(
'selectionchange',
() => {
let 剪切板 = window.getSelection().toString()
if (!剪切板) return
navigator.clipboard.writeText(剪切板).catch(err => {
console.log('内容复制失败', err)
})
},
true
)
})()