-3

There is a website that I visit on a regular basis. It has been adding an additional, unnecessary, and non-functional vertical scrollbar next to the browser's vertical scrollbar.

To fix it, I want to create a user script that changes this line:

<main class="bucket__main">

to

<main class="bucket__main" style="overflow:hidden;">

How can I add overflow:hidden to <main class="bucket_main">?

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • Better approaches are shown in [How to change a class CSS with a Greasemonkey script](http://stackoverflow.com/q/19385698/) and [How to change CSS-classes with Greasemonkey](http://stackoverflow.com/questions/13102195/how-to-change-css-classes-with-greasemonkey). – Brock Adams Jul 02 '16 at 03:54

1 Answers1

0

This should do the trick if there is only one occurence of the class bucket__main:

document.querySelector(".bucket__main").style.overflow='hidden';
elfwyn
  • 568
  • 2
  • 11
  • 33