Hi,
I'm trying to implement a simple adblocker on my TChromium instance. To do so, i want to block the connection to specific domains, like 'ads.facebook', 'googleads.com' and so on.
Is there any event where i can catch every url a page is requesting , check the url and block the ones i want ?
Thanks
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Simple Adblocker
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Simple Adblocker
Hi,
Use the TChromium.OnBeforeResourceLoad event and set the "Result" parameter to RV_CANCEL when you want to block that resource.
These are the details for that event :
https://magpcss.org/ceforum/apidocs3/pr ... llback%3E)
Use the TChromium.OnBeforeResourceLoad event and set the "Result" parameter to RV_CANCEL when you want to block that resource.
These are the details for that event :
https://magpcss.org/ceforum/apidocs3/pr ... llback%3E)
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Simple Adblocker
Hello Salvador !
I could not find this event, but could find this :
BeforeNavigate2
Can this be used instead ?
I could not find this event, but could find this :
BeforeNavigate2
Can this be used instead ?
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Simple Adblocker
Sorry, i was looking at the wrong component, i found it now 
