I would try to implement client handler GetResourceResponseFilter (maybe also OnResourceLoadComplete - here you have browser, frame and URLRequestStatus to decide if is main or subframe, and response as well as the request and received content length).
With CefResourceResponseFilter you have
- Code: Select all
Filter(void* data_in,
size_t data_in_size,
size_t& data_in_read,
void* data_out,
size_t data_out_size,
size_t& data_out_written)
from which you can set data_in_read to data_in and return RESPONSE_FILTER_NEED_MORE_DATA to allow filter to continue, and accumulate data passed in data_in + data_in_size into a buffer.
When OnResourceLoadComplete arrives (or whatever other end condition you have) you might check the buffer for the desired content, trigger your logic, and reset the buffer.
Note. I did not wrote such thing, I am just advancing an opinion here.