Skip to content

Instantly share code, notes, and snippets.

Created May 13, 2021
What would you like to do?
Unlock preventing drag, select, right click
// add this to your bookmark
javascript:(() => {
const events = ['contextmenu', 'drag', 'dragstart', 'selectstart', 'copy', 'cut'];
const styles = ['user-select', '-webkit-user-select', '-moz-user-select', '-ms-user-select', 'pointer-events', '-webkit-pointer-events', '-moz-pointer-events', '-ms-pointer-events'];
events.forEach(event => { window.addEventListener(event, e => {e.stopImmediatePropagation();}, true) });
document.querySelectorAll('body, body *').forEach(el => { styles.forEach(style => {[style] = 'auto !important'; }); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment