Enable Vertical and Horizontal Scrollbar Everywhere

Enable vertical and horizontal page BODY scrolling (for example, where it is disabled if a modal is open).

  1. // ==UserScript==
  2. // @name Enable Vertical and Horizontal Scrollbar Everywhere
  3. // @namespace RW5hYmxlIFZlcnRpY2FsIGFuZCBIb3Jpem9udGFsIFNjcm9sbGJhciBFdmVyeXdoZXJl
  4. // @description Enable vertical and horizontal page BODY scrolling (for example, where it is disabled if a modal is open).
  5. // @author smed79
  6. // @version 1.2
  7. // @encoding utf-8
  8. // @license https://creativecommons.org/licenses/by-nc-sa/4.0/
  9. // @icon https://i.ibb.co/9NBrg0r/icon.png
  10. // @match http://*/*
  11. // @match https://*/*
  12. // @exclude http://*.youtube.com/watch?*
  13. // @exclude https://*.youtube.com/watch?*
  14. // @grant GM_addStyle
  15. // ==/UserScript==
  16.  
  17. function addGlobalStyle(css) {
  18. var head, style;
  19. head = document.getElementsByTagName('head')[0];
  20. if (!head) {
  21. return;
  22. }
  23. style = document.createElement('style');
  24. style.type = 'text/css';
  25. style.innerHTML = css;
  26. head.appendChild(style);
  27. }
  28.  
  29. addGlobalStyle('html { overflow: auto !important; }');
  30. addGlobalStyle('body { overflow: auto !important; }');