How to enable scrolling on website that disabled scrolling?

Javascript

Javascript Problem Overview


How to quickly re-enable scrolling on a website that has disabled scrolling with Javascript? window.scrollBy(0, 100) works fine just can't seem to figure out how to bind this to keys or mouse scroll.

Javascript Solutions


Solution 1 - Javascript

In a browser like Chrome etc.:

  1. Inspect the code (for e.g. in Chrome press ctrl + shift + c);
  2. Set overflow: visible on body element (for e.g., <body style="overflow: visible">)
  3. Find/Remove any JavaScripts that may routinely be checking for removal of the overflow property:
  • To find such JavaScript code, you could for example, go through the code, or click on different JavaScript code in the code debugger console and hit backspace on your keyboard to remove it.
  • If you're having trouble finding it, you can simply try removing a couple of JavaScripts (you can of course simply press ctrl + z to undo whatever code you delete, or hit refresh to start over).

Good luck!

Solution 2 - Javascript

adding overflow:visible !important; to the body element worked for me.

Solution 3 - Javascript

Just thought I would help somebody with this.

Typically, you can just paste this in console.

$("body").css({"overflow":"visible"});

Or, the javascript only version:

document.body.style.overflow = "visible";

Edit: Joshua Goldberg's code from a comment reply:

> I found a similar, bookmarkletable script that did work in this very helpful QA answer that did:

var r="html,body{overflow:auto !important;}"; 
var s=document.createElement("style"); 
s.type="text/css"; 
s.appendChild(document.createTextNode(r)); 
document.body.appendChild(s); 
void 0;

Solution 4 - Javascript

You can paste the following code to the console to scroll up/down using the a/z keyboard keys. If you want to set your own keys you can visit this page to get the keycodes

function KeyPress(e) {
  var evtobj = window.event? event : e
  if (evtobj.keyCode == 90) {
    window.scrollBy(0, 100) 
  }
  if (evtobj.keyCode == 65) {
    window.scrollBy(0, -100) 
  }
}

document.onkeydown = KeyPress;

Solution 5 - Javascript

Select the Body using chrome dev tools (Inspect ) and change in css overflow:visible,

If that doesn't work then check in below css file if html, body is set as overflow:hidden , change it as visible

Solution 6 - Javascript

One last thing is to check for Event Listeners > "scroll" and test deleting them.

Even if you delete the Javascript that created them, the listeners will stick around and prevent scrolling.

Solution 7 - Javascript

With Chrome, one way to automatically re-enable scrolling on a website is to download the Tampermonkey extension, then add this script (click "Install this script").

In general, if you have a URL for a script where the URL ends in .user.js and have Tampermonkey installed, you can paste it into Chrome's Omnibox to install the script. More ways to install scripts with Tampermonkey can be found here.

Solution 8 - Javascript

Try this:

window.onmousewheel = document.onmousewheel = null
window.ontouchmove = null 
window.onwheel = null 

Solution 9 - Javascript

Try ur code to add 'script' is last line or make test ur console (F12) enable scrolling

<script>
(function() {
  for (div=0; div < document.querySelectorAll('div').length; div++) {
    document.querySelectorAll('div')[div].style.overflow = "auto";
  };
})();
</script>

Solution 10 - Javascript

What worked for me was disabling the position: fixed; CSS.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCodeCamperView Question on Stackoverflow
Solution 1 - JavascriptdesignciseView Answer on Stackoverflow
Solution 2 - JavascriptnerdgasmsView Answer on Stackoverflow
Solution 3 - Javascriptuser1274820View Answer on Stackoverflow
Solution 4 - JavascriptFuture SimView Answer on Stackoverflow
Solution 5 - JavascriptPranavjeet.MishraView Answer on Stackoverflow
Solution 6 - JavascriptAndrew RobertsView Answer on Stackoverflow
Solution 7 - JavascriptIdodoView Answer on Stackoverflow
Solution 8 - JavascriptkangaswadView Answer on Stackoverflow
Solution 9 - JavascriptKingRiderView Answer on Stackoverflow
Solution 10 - Javascriptuser14551412View Answer on Stackoverflow