Comprehension of IResourceRequestHandler and interception of requests #3904
ordinaryorange
started this conversation in
General
Replies: 1 comment 5 replies
-
Check the log file and check DevTools to see if there are any clues as to what's going on. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently trying to do some request accounting. By that I mean tracking what requests are sent from the browser and what are received.
I'm overriding the
ResourceRequestHandler.OnBeforeResourceLoadandResourceRequestHandler.OnResourceResponsemethods to track the requests and responses which mostly works, except for the following odd behaviour.For a particular page I'm logging requests & responses on, it issues requests for some fonts.
In my logs from CefSharp I see 2 entries from the
OnBeforeResourceLoad(for the same Url) and only 1 log entry from theOnResourceResponsemethod.I have been running all traffic through a proxy, and when I inspect those logs, the proxy confirms only 1 request/response was processed.
To investigate further, I hooked up the
ResourceRequestHandler.OnResourceLoadCompletefor logging as well.For every
OnBeforeResourceLoadI see a corresponding log entry from theOnResourceLoadCompletemethod.I have a suspicion that the first
OnBeforeResourceLoadrequest is being handled by another subsystem possibly involved with a cache?, and the second then going out the network as a result of a failure of the first, and theOnResourceResponsemethod is bypassed for non network responses ???. (but I'm speculating here)Am I wrong to expect a log from
OnResourceResponsefor everyOnBeforeResourceLoad(excluding lost requests of course) ?If I'm correct about the cache thing, how do I account cache responses, if
OnResourceResponseis not supposed to be called for cache events ?Beta Was this translation helpful? Give feedback.
All reactions