You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider splitting document into document and nested-document. #755
As discussed in the context of Sec-Metadata, it might be useful to clearly distinguish between top-level and nested navigation requests by splitting the document destination into document and nested-document.
@annevk notes that this might be a breaking change, as folks might be relying on the existing document destination that's exposed on Request objects. @wanderview, @jakearchibald: WDYT?
Since Request.destination was only relatively recently shipped in browsers, now might be the time to make this change. Sites would need to adapt, but they could do evt.request.destination.includes('document') or something.
FWIW, this better matches what firefox uses internally:
I was wondering if this change would interact badly with the portals proposal, but I guess the navigation request would have to complete well before any portal is promoted from 3rd party to 1st party.
I am not totally clear about the intent of this change.
Is it to allow a simpler definition/implementation of Sec-Metadata?
Is it to allow service worker to start acting as some sort of security proxy that could decide to stop loads based on a better knowledge of the client triggering the fetch?
FWIW, WebKit has this is-top-level-navigation concept, although at a slightly lower level. The proposed change seems ok from that prospective.
The same information could be made available elsewhere in a backward compatible way: fetch event or service worker client for instance.
Is it to allow service worker to start acting as some sort of security proxy that could decide to stop loads based on a better knowledge of the client triggering the fetch?
That's also a distinction that I think might be useful, but it's not my intent. Offering that capability to developers would be a happy side-effect of this change. :)
Given a service worker might expose the same data that servers would provide directly, it makes sense to me that a service worker should get the same level of information as the one provided to the server through Sec-Metadata, at least for navigation loads.
The cause member information does not seem to be exposed to service worker.
The same-site value might be somehow exposed although computing the public suffix might be more easily done by the browser.
Do you mean resultingClientId? You won't be able to look at any information about that client until after the fetch completes, right?
Also, I don't think client.ancestorOrigins has been implemented widely yet due to privacy concerns being resolved with the main thread ancestorOrigins API. I think we still have client.frameType, though, until that is resolved.
The idea of exposing the header to service workers sounds interesting.
My initial thought is what'd be a downside of maintaining the target member? The values of the destination look more like what the request's resulting resource kind would be. If we split them, there seems to be quite a few places that need some clarification. E.g. "A navigation request is a request whose destination is "document" or "nested-document", etc.
Do you mean resultingClientId? You won't be able to look at any information about that client until after the fetch completes, right?
There seems to be some level of agreement that splitting document might be a reasonable thing to do. If I send out a PR against Fetch, HTML, and added some tests, would other vendors implement the change? :)
@wanderview wouldn't targetClientId be the right thing to look at here?
I think we answered this on IRC. Since targetClientId will be null for cross-origin targets or new top level windows it can't really be used reliably to determine the type of request.
If it ends up not being exposed, and "nested-navigate" request.mode is a thing, I guess we can somehow live with that spec-complexity and map as values to that.
Activity
wanderview commentedon Jun 5, 2018
Since Request.destination was only relatively recently shipped in browsers, now might be the time to make this change. Sites would need to adapt, but they could do
evt.request.destination.includes('document')or something.FWIW, this better matches what firefox uses internally:
https://searchfox.org/mozilla-central/rev/292d295d6b084b43b70de26a42e68513bb7b36a3/dom/base/nsIContentPolicy.idl#87-96
Which we then map to the exposed
documentdestination:https://searchfox.org/mozilla-central/rev/292d295d6b084b43b70de26a42e68513bb7b36a3/dom/fetch/InternalRequest.cpp#274-277
I was wondering if this change would interact badly with the portals proposal, but I guess the navigation request would have to complete well before any portal is promoted from 3rd party to 1st party.
mikewest commentedon Jun 5, 2018
Thanks, @wanderview, that's helpful. Who should we loop in from WebKit/Edge to see if they'd be willing to do the same?
wanderview commentedon Jun 5, 2018
I think @youennf can speak to the fetch API in webkit.
I'm not sure for edge. Maybe @aliams or @jungkees can help.
youennf commentedon Jun 5, 2018
I am not totally clear about the intent of this change.
Is it to allow a simpler definition/implementation of Sec-Metadata?
Is it to allow service worker to start acting as some sort of security proxy that could decide to stop loads based on a better knowledge of the client triggering the fetch?
FWIW, WebKit has this is-top-level-navigation concept, although at a slightly lower level. The proposed change seems ok from that prospective.
The same information could be made available elsewhere in a backward compatible way: fetch event or service worker client for instance.
mikewest commentedon Jun 5, 2018
Hey, @youennf!
Right now,
Sec-Metadatadefines atargetattribute to describe the target browsing context of a navigation request: https://mikewest.github.io/sec-metadata/#target-member. It would be ideal if we could get rid of that member by folding thetop-level/nesteddistinction into thedestination.That's also a distinction that I think might be useful, but it's not my intent. Offering that capability to developers would be a happy side-effect of this change. :)
youennf commentedon Jun 5, 2018
That seems reasonable to me.
Given a service worker might expose the same data that servers would provide directly, it makes sense to me that a service worker should get the same level of information as the one provided to the server through Sec-Metadata, at least for navigation loads.
The cause member information does not seem to be exposed to service worker.
The same-site value might be somehow exposed although computing the public suffix might be more easily done by the browser.
jakearchibald commentedon Jun 6, 2018
Isn't this information (and more) already available by getting the client associated with
fetchEvent.targetClientId, then looking at itsclient.ancestorOrigins?wanderview commentedon Jun 6, 2018
Do you mean
resultingClientId? You won't be able to look at any information about that client until after the fetch completes, right?Also, I don't think
client.ancestorOriginshas been implemented widely yet due to privacy concerns being resolved with the main thread ancestorOrigins API. I think we still haveclient.frameType, though, until that is resolved.jungkees commentedon Jun 11, 2018
The idea of exposing the header to service workers sounds interesting.
My initial thought is what'd be a downside of maintaining the target member? The values of the destination look more like what the request's resulting resource kind would be. If we split them, there seems to be quite a few places that need some clarification. E.g. "A navigation request is a request whose destination is "document" or "nested-document", etc.
Yes.
jakearchibald commentedon Jun 14, 2018
@wanderview wouldn't
targetClientIdbe the right thing to look at here?mikewest commentedon Jun 14, 2018
There seems to be some level of agreement that splitting
documentmight be a reasonable thing to do. If I send out a PR against Fetch, HTML, and added some tests, would other vendors implement the change? :)wanderview commentedon Jun 15, 2018
I think we answered this on IRC. Since targetClientId will be null for cross-origin targets or new top level windows it can't really be used reliably to determine the type of request.
mikewest commentedon Oct 24, 2018
@arturjanc reminded me that I never came back to this.
Do y'all think it's worth trying to poke at
destinationin this way? Or would y'all prefer introducing a new concept onrequestobjects instead?8 remaining items
yoavweiss commentedon Mar 14, 2019
OK, I read the thread on the issue, and IIUC there's still an open question there on whether we want to expose
request.destinationto servers, right?If it is exposed, I think it'd be cleaner to have nestedness be part of
destination.yoavweiss commentedon Mar 14, 2019
If it ends up not being exposed, and "nested-navigate"
request.modeis a thing, I guess we can somehow live with that spec-complexity and mapasvalues to that.[WIP] Set `Sec-Fetch-Mode` from the network service.
Set `Sec-Fetch-Mode` from the network service.
Set `Sec-Fetch-Mode` from the network service.
Set `Sec-Fetch-Mode` from the network service.
Set `Sec-Fetch-Mode` from the network service.
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…
annevk commentedon Jan 29, 2021
This was fixed by #948.
Bug 1578739 [wpt PR 18838] - Set `Sec-Fetch-Mode` from the network se…