-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Milestone
Description
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 requests- in RPC, this is the
RequestMemory
- in RPC, this is the
tabContextManagerkeeps track (as accurately as possible) of which root document belongs to which tabtabContexts: 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.jsnormalizeRequestDetails: essentially, setanyTabId, which is checked against only inonBeforeBehindTheSceneRequest(traffic.js)
- µb
tab.jsupdateBadgeAsync=updateBlockedContentStateAfterTimeout
These are the subtasks of this issue (incomplete)
- test
TabContextManager- create/copy
TabContextclass - create/copy
Contextclass - create
"tabs.contexts"module -
vAPIfunctions -> own functions -
µbfunctions -> own functions- the functions
µb.normalizePageURL()µb.URI.hostnameFromURI()µb.URI.domainFromHostname()
- create the
TabContextpropertiesnormalURLrootHostnamerootDomain
- , respectively.
- which of those properties do we need on
lookup()invocations?
- the functions
- call commit() and push()
- uBO calls these functions in
onBeforeRootFrameRequestonHeadersReceivedtabs.onUpdatedtabs.onNavigation
- uBO calls these functions in
- …
- create/copy
- …