Split out from #4, which explains the problems with the existing implementations.
A programmatic HTTP request happens-before every UI update that depends on it. We can also reasonably assume that every UI update happens within some short time (e.g., 1s) of the HTTP response being received. Together these give a way to heuristically map UI updates back to HTTP requests in a many-to-many fashion, based on time:
When an XMLHttpRequest is made, add the request ID to a global set of "active requests". MAX_UI_UPDATE seconds after the response is received, remove that request ID from the set.
For every UI element modification detected by MutationObserver, record the set of active requests against that element (either in the element itself or some lookup table off to the side).
When the user opens the browser extension's list of all provenance-enriched HTTP responses and selects a response, highlight all elements on the page tagged with that request ID.
Split out from #4, which explains the problems with the existing implementations.
A programmatic HTTP request happens-before every UI update that depends on it. We can also reasonably assume that every UI update happens within some short time (e.g., 1s) of the HTTP response being received. Together these give a way to heuristically map UI updates back to HTTP requests in a many-to-many fashion, based on time:
XMLHttpRequest
is made, add the request ID to a global set of "active requests".MAX_UI_UPDATE
seconds after the response is received, remove that request ID from the set.MutationObserver
, record the set of active requests against that element (either in the element itself or some lookup table off to the side).