-
Notifications
You must be signed in to change notification settings - Fork 67
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
Ephemeral navigation portals #192
Comments
Ohhh I hadn't considered something like
I think the "risky time" for a portal like is, is when it can run script, and it isn't top level. So, The promise would reject with an abort error if the navigation is stopped or cancelled somehow, like the user hitting the stop button, or another navigation taking priority.
+1 to I'm less sure about Need to think of how this would fit in with the |
If activation can fail in a way that keeps the page presented, I think The idea of having the result not resolve until a document commits is interesting, though it is kinda equivalent to having the portal element have a promise that resolves when a document commits (which is similar to the |
The
Yeah, a value on the portal is probably better. It's ok to add it to third party portals, because you can already access this timing with iframes. It's ok to add it to |
This interacts with the mitigations identified in #208 as "Blocked by preventing fetches within portals from using credentials until they're activated". That needs at least one extra mitigation here:
|
Can we do whatever we do for repeated assignments to |
The mitigations that had previously been proposed were to require a user gesture and for the UA to activate such a portal if the document doesn't do so within some window (and it isn't cancelled by some other navigation -- I haven't given Saying you can only do so once for a page's lifetime seems infeasible -- because it would preclude any further outgoing navigations after restoring from bfcache or similar. What about, as @jakearchibald says, whatever mitigation is appropriate for the page navigating itself to URLs that serve 204 responses? |
Not just 204 responses, it could be a never-response, which the browser can't really distinguish from a slow response, except via timeouts. |
It makes sense to plan to match whatever we wind up doing for assignments to |
@jakearchibald has previously proposed in a few places that it be possible to load a portal which would have immediate access to its first-party storage in exchange for a UA-enforced guarantee that it will be activated within some fixed timeframe (say, five seconds). This could be hooked onto existing content-initiated navigations (e.g. links, form submissions) through a hypothetical
navigate
event, which would look something like:I suspect we'd need a few more features if we took such a direction, like telling the author what the deadline is and letting them observe the result of an implicit activation (esp. if it can be rejected).
Either way, I think there are some open questions, especially since we can't actually guarantee that the forced activation will actually be possible. For instance, the request could result in a 204 No Content response, a network or TLS error, abort (including via
AbortController
if we allow that to be configured on the request), etc. after a credentialed request has already been sent, and of course we could need to cancel due to a concurrent navigation being initiated.If the conditions for doing this are similar to initiating a navigation that might result in a 204 response, then we may be okay but I think there are details that merit investigation if we want to pursue something along these lines.
The text was updated successfully, but these errors were encountered: