Example: Remove an ad sidebar
This presumes that there is an element whose ID is "ads".
var adSidebar = document.getElementById('ads');
if (adSidebar) {
adSidebar.parentNode.removeChild(adSidebar);
}|
Removing an element with |
|
If all you want to do is remove ads, it's probably easier to install AdBlock and import an up-to-date filter list than to write your own user script. |