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.

How to stop/abort/the request?

Post Reply
zaqaz
Posts: 15
Joined: Wed Nov 30, 2022 8:59 pm

How to stop/abort/the request?

Post by zaqaz »

How to stop/abort/the request?

I want stop js-generated-request on loaded page.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to stop/abort/the request?

Post by salvadordf »

Hi,

If you know the URL of that request then you can use the TChromiumCore.OnBeforeResourceLoad event which has these code comments :

Code: Select all

  ///
  /// Called on the IO thread before a resource request is loaded. The |browser|
  /// and |frame| values represent the source of the request, and may be NULL
  /// for requests originating from service workers or cef_urlrequest_t. To
  /// redirect or change the resource load optionally modify |request|.
  /// Modification of the request URL will be treated as a redirect. Return
  /// RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC
  /// and call cef_callback_t functions at a later time to continue or cancel
  /// the request asynchronously. Return RV_CANCEL to cancel the request
  /// immediately.
  ///
Implement that event, compare the request.Url and request.ResourceType values and set Result to RV_CANCEL when you decide to block that request.
zaqaz
Posts: 15
Joined: Wed Nov 30, 2022 8:59 pm

Re: How to stop/abort/the request?

Post by zaqaz »

thank you
Post Reply