One important current question is: On a page load— when a new page is replaced by an old one —how to determine whether a request belongs to the new or the old page?
I'm probably going to use some uBO code here. uBO's implementation includes:
PageRequestStore objects are used to store net requests
- in RPC, this is the
RequestMemory
tabContextManager keeps track (as accurately as possible) of which root document belongs to which tab
tabContexts: Map<tabId, TabContext>
- connecting logic in … (reverse call tree)
bindTabToPageStats()
onHeadersReceived (traffic.js) — context="beforeRequest"
httpObserver.handleResponseHeaders (platform/firefox/vapi-background.js)
onHeadersReceived (platform/webext/vapi-webrequest.js)
onBeforeRootFrameRequest / onBeforeRequest (traffic.js) — context="beforeRequest"
httpObserver.handleRequest (platform/firefox/vapi-background.js)
onBeforeRequest (platform/webext/vapi-webrequest.js)
onUpdated (tab.js) — context="tabUpdated"
locationChangedListener (platform/firefox/vapi-background.js)
onNavigation (tab.js) — context="tabCommitted"
locationChangedListener (platform/firefox/vapi-background.js)
onBeforeRequest (traffic.js)
- µb
tab.js
normalizeRequestDetails: essentially, set anyTabId, which is checked against only in onBeforeBehindTheSceneRequest (traffic.js)
- µb
tab.js
updateBadgeAsync = updateBlockedContentStateAfterTimeout
These are the subtasks of this issue (incomplete)
One important current question is: On a page load— when a new page is replaced by an old one —how to determine whether a request belongs to the new or the old page?
I'm probably going to use some uBO code here. uBO's implementation includes:
PageRequestStoreobjects are used to store net requestsRequestMemorytabContextManagerkeeps track (as accurately as possible) of which root document belongs to which tabtabContexts: Map<tabId, TabContext>bindTabToPageStats()onHeadersReceived(traffic.js) —context="beforeRequest"httpObserver.handleResponseHeaders(platform/firefox/vapi-background.js)onHeadersReceived(platform/webext/vapi-webrequest.js)onBeforeRootFrameRequest/onBeforeRequest(traffic.js) —context="beforeRequest"httpObserver.handleRequest(platform/firefox/vapi-background.js)onBeforeRequest(platform/webext/vapi-webrequest.js)onUpdated(tab.js) —context="tabUpdated"locationChangedListener(platform/firefox/vapi-background.js)onNavigation(tab.js) —context="tabCommitted"locationChangedListener(platform/firefox/vapi-background.js)onBeforeRequest(traffic.js)tab.jsnormalizeRequestDetails: essentially, setanyTabId, which is checked against only inonBeforeBehindTheSceneRequest(traffic.js)tab.jsupdateBadgeAsync=updateBlockedContentStateAfterTimeoutThese are the subtasks of this issue (incomplete)
TabContextManagerTabContextclassContextclass"tabs.contexts"modulevAPIfunctions -> own functionsµbfunctions -> own functionsµb.normalizePageURL()µb.URI.hostnameFromURI()µb.URI.domainFromHostname()TabContextpropertiesnormalURLrootHostnamerootDomainlookup()invocations?onBeforeRootFrameRequestonHeadersReceivedtabs.onUpdatedtabs.onNavigation