Greasy Fork is available in English.
Enable copy and text selection on all websites including right click
// ==UserScript==
// @name Enable Copy Everywhere
// @namespace https://greasyfork.org/en/users/1375891-wibu-elite
// @version 1.0
// @description Enable copy and text selection on all websites including right click
// @author Kinnena
// @match *://*/*
// @icon https://img.icons8.com/?size=160&id=XR4FYU3AnFyS&format=png
// @grant none
// @license MIT
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// 1. Enable text selection via CSS
const style = document.createElement('style');
style.innerHTML = `
* {
user-select: text !important;
-webkit-user-select: text !important;
-ms-user-select: text !important;
}
`;
document.head.appendChild(style);
// 2. Remove event listeners that block copy
const events = [
'copy',
'cut',
'paste',
'contextmenu',
'selectstart',
'mousedown',
'mouseup',
'keydown'
];
events.forEach(event => {
document.addEventListener(event, e => {
e.stopPropagation();
}, true);
});
// 3. Enable right click explicitly
document.oncontextmenu = null;
// 4. Remove inline handlers
const all = document.querySelectorAll('*');
all.forEach(el => {
el.oncopy = null;
el.oncut = null;
el.onpaste = null;
el.oncontextmenu = null;
el.onselectstart = null;
el.onmousedown = null;
});
})();