Skip to content

Instantly share code, notes, and snippets.

@rushkeldon
Created January 25, 2018 19:39
Show Gist options
  • Save rushkeldon/6870d8677eafd39f3953ea13b34facdb to your computer and use it in GitHub Desktop.
Save rushkeldon/6870d8677eafd39f3953ea13b34facdb to your computer and use it in GitHub Desktop.
Stops all scrolling events on a page from being handled by javascript. Paste in your console for Google Slides when using a Magic Mouse (for example)
function blockScroll( e ){
e.preventDefault();
e.stopPropagation();
e.cancelBubble = true;
}
document.addEventListener('wheel', blockScroll, true );
document.addEventListener('mousewheel', blockScroll, true );
document.addEventListener('DOMMouseScroll', blockScroll, true );
@rushkeldon
Copy link
Author

There is an extension in Chrome 'Custom JavaScript' which will execute a script every time you visit a particular domain or page. That could be useful for this script. https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija?hl=en

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment