Combine multiple chrome apis in order to detect pending requests.
By collecting data using three apis
chrome.webRequest.onBeforeRequest
chrome.webRequest.onBeforeSendHeaders
chrome.devtools.network.onRequestFinished
Up until now the app used onRequestFinished only to detect requests, however this only fires when a request has completed. onBeforeRequest fires when a request starts, but there was no clear way to associate these two events. No identifier is available.
Instead the app now compares multiple data points, including the url, method and request body to make an assumption about which events are associated from each api.
I have heavily refactored the network detection code and included new tests for edge cases like multipart uploads and persisted queries.
Description
Combine multiple chrome apis in order to detect pending requests.
By collecting data using three apis chrome.webRequest.onBeforeRequest chrome.webRequest.onBeforeSendHeaders chrome.devtools.network.onRequestFinished
Up until now the app used
onRequestFinished
only to detect requests, however this only fires when a request has completed. onBeforeRequest fires when a request starts, but there was no clear way to associate these two events. No identifier is available.Instead the app now compares multiple data points, including the url, method and request body to make an assumption about which events are associated from each api.
I have heavily refactored the network detection code and included new tests for edge cases like multipart uploads and persisted queries.
Screenshot
https://github.com/warrenday/graphql-network-inspector/assets/2871038/6547fc5d-fd64-4451-acc1-3e8d14aa637f
Checklist