Mike Pharma recently launched its new landing page to host a crowd funding campaign . The page uses an external library to display third party ads . Once the page is loaded fully , it creates more than 50 new html items placed randomly inside the DOM like the one below .
Why should it only be temporary? Then you have to do it every time that you visit the page.
It’s much better to “one and done” the situation and use something like uBlock Origin (which I personally use) to remove the advertising once, for this visit and all future visits.
For example, using the picker, you can select elements on the page to remove them, such as this community ad.
I’m in agreement with you there. Even though the homework answers have one answer that’s more suitable than all the rest, it’s important not to be blinded to other better solutions that haven’t yet been presented.
Hi @tjsreedhar, the DOM inspector could be used but that would be rather cumbersome – you’d have to search for class="ad-lib-hidden" or something, then right-click each matched element and select “delete element”.
As for preventing the load event to be fired, not sure if this is even possible but that would also affect “righteous” load event listeners. Also, you’d have to be rather quick.
So I’d go with using the browser console to remove the unwanted elements… as a one-liner: