-
Notifications
You must be signed in to change notification settings - Fork 25
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
Should we really be extending window.open()? #2
Comments
Thanks for bringing this up. I think the existing APIs should behave sane in a multi-screen environment, as a bare minimum. This means window.open/moveTo/moveBy should aim to respect reasonable coordinates, and not clamp window creation and movement to the screen currently hosting the content (in some implementations, like Chrome). That should suffice for some use cases and requires less overall change to the current web platform and usage patterns. If clients.openWindow were made available in all contexts, that makes the alternate/supplemental proposal even more appealing, but I still see fixing the existing behavior, with a sufficient (albeit awkward) API surface, as "step one". Please share more thoughts on this, so we can set an appropriate direction early on, thanks! |
Making the existing functionality of window.open do reasonable things sounds reasonable to me, yes (although from the explainer it sounds like that is really more an implementation detail currently, and some implementation already do that? I.e. that's more a "we should fix our implementation" rather than a "we should fix the standard" situation? I guess unless you think we should constrain what user agents are allowed to do in the "user-agent-defined manner" bits of https://drafts.csswg.org/cssom-view/#set-up-browsing-context-features (which I guess is what you're suggesting in the "leading proposal" bit). I also wonder how feature detection would work with the So it seems like we can fix our implementation for (Also you've almost certainly spent a lot more time thinking about this than I have, so I'm sure there are things I'm missing as well). |
Yes, ideally I'd like to change Chromium's user-agent-defined manner of clamping x and y for If I'll aim to clarify my proposal and explore these openWindow ideas more in the explainer. Thanks! |
I've been thinking about this a bit lately as well. Thinking about all the possible things we'll want in this kind of system later (like grouping windows together possibly) it becomes problematic to be using Personally I settled myself on, for now modifying Simply put, I don't see enough justification given our current scope to go modifying old API parameters or restricting where the new things can be used. |
I completely agree, having a new API such as openWindow will help in progressive enhancement
a modern API would mean we get Promise based async return values & extendable object dictionary for options rather than the ugly DOMString options. |
Thanks for contributing insight here! I have modified the proposal to make it clear that there are multiple aspects worth pursuing upfront, and have attempted to convey a similar prioritization of extending openWindow in addition to fixing existing window API impls/specs. Also, please note that nothing in the spec (nor in some implementations, like Firefox) is stopping you from using window.open/moveTo/MoveBy to go out of monitor bounds, it's just current user-agent-defined behavior; I hope to explore and document (and fix!) the variation among implementations here soon. Please reopen this issue if there's more to address in the explainer, otherwise feel free to continue commenting here with additional thoughts, context, and use cases that don't require explainer changes. |
If
clients.openWindow
would be made available in all contexts (w3c/ServiceWorker#955), does it really make sense to bolt on this new functionality to window.open(), and its awkward synchronous and string parsing based API, or would it make more sense to stick to only adding the new functionality toclients.openWindow
?I see you've listed this as an "Alternative or Supplemental" proposal, but it's not clear to me why the leading proposal is the leading proposal (i.e. why is it the better option)?
The text was updated successfully, but these errors were encountered: