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.

Content blocking

Post Reply
dilfich
Posts: 331
Joined: Thu Nov 30, 2017 1:17 am

Content blocking

Post by dilfich »

Hi!
How do I stop or prevent certain items from loading? For example, the page loads a script or image or styles, you need to disable / block some of them.
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Content blocking

Post by salvadordf »

Use TChromium.OnBeforeResourceLoad

These are the CEF3 code comments about that event :

Code: Select all

  ///
  // Called on the IO thread before a resource request is loaded. The |request|
  // object may be modified. Return RV_CONTINUE to continue the request
  // immediately. Return RV_CONTINUE_ASYNC and call cef_request_tCallback::
  // cont() at a later time to continue or cancel the request asynchronously.
  // Return RV_CANCEL to cancel the request immediately.
  //
  ///
dilfich
Posts: 331
Joined: Thu Nov 30, 2017 1:17 am

Re: Content blocking

Post by dilfich »

sorry :oops:
Post Reply