on a website i visit, i want to remove an ad-link from the page by writing script. how would i remove the <a href-"ad">ad</a>
page element? I guess the best way would be using javascript, and using a tampermonkey chrome extension to run the script. otherwise, using stylish and a css script.
<div class=main>
<h2>Title</h2>
<div class=stuff>
//bunch of other stuff
</div>
<a href="ad.com">ad</a>
</div>
I have made a chrome extension for this purpose, named Js-Injector. It is available from github on https://github.com/shahverdy/JS-Injector. Unfortunately I can not deploy it on Chrome Web Store, because of US sanctions on my country. There are some samples in extension for this purpose, you can easily work with it.
In Js-Injector you can add the following code for your website:
$(function(){
$("a[href='ad.com']").remove();
})
EDIT: There are some other extensions like Tampermonkey available. But there are some important issues that should be considered at the time of choosing proper extension:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With