One way to do it is use an extension that allows scripts to be added to a webpage.
I used the extension Quickscript for Safari. I created the following script to run and delete by classname every time I open the webpage:
removeElementsByClass('<className to delete>'); function removeElementsByClass(className){ var elements = document.getElementsByClassName(className); while(elements.length > 0){ elements[0].parentNode.removeChild(elements[0]); } }
Another way is to delete by item id.
removeElementsById('<id to delete>'); function removeElementsById(id){ var elements = document.getElementById(id); while(elements.length > 0){ elements[0].parentNode.removeChild(elements[0]); } }
This can also be accomplished by creating a function using jquery.
removeElementsById('#<id to delete>'); removeElementsByClass('.<className to delete>'); function removeElementsByClass(className){ $(className).remove(); } function removeElementsById(id){ $(id).remove(); }
Note: This solution is browser and OS independent. It only requires you find an extension that allows you to run scripts on websites.
Custom JavaScript for websites will work with chrome.