Move userscripts into scripts/ subfolder
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// ==UserScript==
|
||||
// @name Paste Enabler
|
||||
// @version 0.0.1
|
||||
// @description Re-enables paste functionality on websites
|
||||
// @author Evan Reichard
|
||||
// @match *://*/*
|
||||
// @grant GM.registerMenuCommand
|
||||
// @noframes
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const enablePasteFunction = function() {
|
||||
const events = ['paste', 'copy', 'cut'];
|
||||
events.forEach(function(event) {
|
||||
document.addEventListener(event, function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
return true;
|
||||
}, true);
|
||||
});
|
||||
|
||||
document.querySelectorAll('input, textarea').forEach(function(el) {
|
||||
el.setAttribute('oncopy', 'return true');
|
||||
el.setAttribute('onpaste', 'return true');
|
||||
el.setAttribute('oncut', 'return true');
|
||||
el.removeAttribute('readonly');
|
||||
});
|
||||
};
|
||||
|
||||
// Register the menu command
|
||||
GM.registerMenuCommand("Enable Paste", enablePasteFunction, "p");
|
||||
})();
|
||||
Reference in New Issue
Block a user