Created
January 19, 2024 02:04
-
-
Save varenc/1bd977a3edbe11b160598d5c0c6ae15e to your computer and use it in GitHub Desktop.
Force iccsafe.org code text to be selectable and copyable
This file contains 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
function __unblockEvents(){for(var i=0;i<arguments.length;i++){document.addEventListener(arguments[i],function(e){e.stopPropagation();console.log("event received and unblocked:",e);},true);}}; | |
__unblockEvents('keydown','keyup','keypress','copy','contextmenu','beforeprint','afterprint'); | |
document.head.appendChild(Object.assign(document.createElement("style"), {textContent: "* { user-select: initial !important; }"})); | |
// TODO: disabling 'beforeprint' doesnt seem to work. Fix that so its printable. Use Chrome Dev tools to remove that event handler manually in the mean time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment