Skip to content

Instantly share code, notes, and snippets.

@brunohubner
Created December 21, 2025 01:03
Show Gist options
  • Select an option

  • Save brunohubner/893bba544aa04f48c678bb7e53eaf31c to your computer and use it in GitHub Desktop.

Select an option

Save brunohubner/893bba544aa04f48c678bb7e53eaf31c to your computer and use it in GitHub Desktop.
function removerBloqueioSelecaoTextoWeb() {
try {
document.querySelectorAll('*').forEach(el => {
el.style.userSelect = 'text';
el.style.webkitUserSelect = 'text';
el.style.msUserSelect = 'text';
});
} catch (e) {
//
}
try {
const cloneX = document.cloneNode(true);
document.replaceWith(cloneX);
} catch (e) {
//
}
try {
[
"copy",
"cut",
"paste",
"contextmenu",
"selectstart",
"mousedown",
"mouseup",
"keydown",
"keypress"
].forEach(evt => {
document.body.addEventListener(evt, e => e.stopPropagation(), true);
});
} catch (e) {
//
}
}
removerBloqueioSelecaoTextoWeb();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment