Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebExtension port] move from nsIContentPolicy etc. to WebRequest etc. #891

Open
4 of 7 tasks
myrdd opened this issue Apr 4, 2018 · 0 comments
Open
4 of 7 tasks

Comments

@myrdd
Copy link
Member

myrdd commented Apr 4, 2018

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)

  • test TabContextManager
    • create/copy TabContext class
    • create/copy Context class
    • create "tabs.contexts" module
    • vAPI functions -> own functions
    • µb functions -> own functions
      • the functions
        • µb.normalizePageURL()
        • µb.URI.hostnameFromURI()
        • µb.URI.domainFromHostname()
      • create the TabContext properties
        • normalURL
        • rootHostname
        • rootDomain
      • , respectively.
      • which of those properties do we need on lookup() invocations?
    • call commit() and push()
      • uBO calls these functions in
        • onBeforeRootFrameRequest
        • onHeadersReceived
        • tabs.onUpdated
        • tabs.onNavigation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant