Last active
September 28, 2024 22:14
-
-
Save emlyn/e8a626ad794d36eb0856655c32bcf955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Don't F With Paste | |
// @description Stop idiots who think they're clever | |
// @downloadURL https://gist.github.com/emlyn/e8a626ad794d36eb0856655c32bcf955/raw/dontfwithpaste.user.js | |
// @updateURL https://gist.github.com/emlyn/e8a626ad794d36eb0856655c32bcf955/raw/dontfwithpaste.user.js | |
// @namespace https://gist.github.com/emlyn | |
// @version 0.2 | |
// @author Emlyn Corrin | |
// @match http*://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Don't run on these hosts: | |
const blacklist = new Set(['docs.google.com']); | |
const allowPaste = function(e){ | |
e.stopImmediatePropagation(); | |
return true; | |
}; | |
if (!blacklist.has(window.location.host)) { | |
document.addEventListener('paste', allowPaste, true); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment