Page 1 of 1

How to stop/abort/the request?

Posted: Wed Nov 30, 2022 9:07 pm
by zaqaz
How to stop/abort/the request?

I want stop js-generated-request on loaded page.

Re: How to stop/abort/the request?

Posted: Thu Dec 01, 2022 1:32 pm
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.

Re: How to stop/abort/the request?

Posted: Thu Dec 08, 2022 6:45 am
by zaqaz
thank you