-
Notifications
You must be signed in to change notification settings - Fork 26
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
Enqueue launch events for every app launch #33
Comments
It would be reasonable for the service worker path to override the |
I think this is a reasonable take. I'm not sure what the point of |
|
I'm really liking this. It's good to periodically rethink a design that was rather hastily put together and hasn't really been questioned since I wrote it. Things that I like about it:
Some other thoughts:
For completeness, pasting a private email from @alancutter here, which explains the mapping from the previous design to the above proposal:
|
In Chrome's implementation there is no such thing as no link capturing. It's a user choice that the site has no control over (similar to users forcing web apps to open in a window/browser tab). |
I like this structure. Questions:
|
If we want to provide that granularity I envision just embedding this
The old one can't:
This change is less about adding more capabilities and more about decoupling orthogonal concepts from the original DLC concept. |
Great suggestion from glenrob: Remove This makes the service worker event a way of "explaining" the declarative behaviour as a more procedural browser pipeline primitive. |
So IIUC there are now 4 possible behaviours (please correct me if I'm describing it wrong):
It seems to me that 3 and 4 would be better handled by a service worker event - less overhead and no declaration needed assuming we always fire the SW event, and able to customise the behaviour based on what URL is coming in. |
So there would still be
OK, so then what is the default value of It seems that in Chrome's implementation, |
This would make
Yes, if we have any link capturing specific configurations we want to provide e.g. excluding sub paths and link-capture-specific
It should probably be |
Yes. This was essentially the whole insight behind DLC in the first place, as an evolution on the older sw-launch plans (see the Overview section of the DLC explainer):
It's not only what we think will be the overwhelmingly common case, but it also means we can ship it without having to do a major implementation project on the guts of the navigation flow (& that follows for all the browser engines). |
alancutter@ and I chatted about this. I can see the value in the decomposition into 2x2 properties now. They make more sense than the old 3 names (new client navigate (default), existing client event, existing client navigate) in the context that we are always sending the event. My only remaining note is that "3. route_to: new-client + navigate_client: false" is quite an odd option, and most likely to be handled better by a service worker eventually, so we should avoid adding new_client_url to support that case, just use start_url. I think the service worker approach wouldn't be much more complex for sites to implement but I can see how it would be more complex for the browser if we have to drop in to SW code to check if the event is handled during the navigation. Possibly we'd want to make that part declarative somehow. This is just musing though. The proposal (except new_client_url) LGTM. |
@phoglenix Re
But I thought Alan explained (must've been privately): Having said that, I'm fine if it doesn't appear in the MVP. It isn't crucial. |
I think |
Yes, I agree, in theory / conceptually @alancutter . However, in practice, I think the Edit: Which I see you have done in the explainer (NCU is listed as a future work). |
I think if you want a lightweight page to fire an event at, you're better off with a service worker. |
Well let's talk practical terms. Say you've got a video chat client with two pages:
Let's assume both of these pages load non-trivial resources that are unique to that page and not the other. And you want the single-window mode option so if you start a new video call, you focus the existing window and show a dialog asking if the user wants to switch to the new call. I think in this case the ideal architecture is:
In light of that ... maybe Hurr.... okay so actually, I think this has introduced a bit of a design flaw, @alancutter , when compared to my DLC proposal. In the DLC proposal, So maybe what we need is for
(As a bonus, it removes the awkward "string or Boolean" type that you had with Now we can map the previous DLC proposal onto the new one:
Then maybe we don't need |
In CSS spec land they don't let you use true/false, you have to use enum values like |
This was added to the explainer. |
In the same vein as w3c/web-share-target#84 (comment):
I propose that we always enqueue the launch event for any app launch (link capturing, OS app launch, menu shortcuts, file handlers, share target...).
What does this mean for
existing-client-navigate
vsexisting-client-event
? It removes the "event" aspect and leaves behind "navigation".If we always enqueue launch events then the behavioural options for the developer become "which app window gets used" and "whether the browser automatically navigates the app window to the launch URL".
Possible restructuring of the API:
new_client_url
defaults tostart_url
if unset/null.This decomposes the "launching" of the app into two configurable pipeline steps:
route_to
Choose which app client to launch in (possibly new).
new-client
.new-client
if no client selected.navigate_client
Choose whether to navigate that window to the launch URL or let JS handle that.
new_client_url
. App clients that receive a launch have a launch event enqueued containing the launch URL.The text was updated successfully, but these errors were encountered: