-
-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathcopyModify.user.js
More file actions
28 lines (28 loc) · 842 Bytes
/
copyModify.user.js
File metadata and controls
28 lines (28 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* eslint-env browser */
// ==UserScript==
// @name copyModify
// @description copyModify
// @include *
// @version 1.0.7
// @created 2020-12-05 15:44:53
// @modified 2024-07-09 21:13:40
// @author dodying
// @namespace https://github.com/dodying/UserJs
// @supportURL https://github.com/dodying/UserJs/issues
// @icon https://github.com/dodying/UserJs/raw/master/Logo.png
// @run-at document-end
// @grant none
// @noframes
// ==/UserScript==
/* eslint-disable no-debugger */
(function () {
document.addEventListener('copy', (e) => {
const text = window.getSelection().toString().trim();
if (text) {
// GM_setClipboard(text);
e.clipboardData.setData('text/plain', text);
e.clipboardData.setData('text/html', text);
}
e.preventDefault();
}, false);
}());