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

Window.open() needs an overhaul #4583

Closed
wbamberg opened this issue Apr 29, 2021 · 14 comments · Fixed by #12425 or #18118
Closed

Window.open() needs an overhaul #4583

wbamberg opened this issue Apr 29, 2021 · 14 comments · Fixed by #12425 or #18118
Assignees
Labels
Content:WebAPI Web API docs good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help!

Comments

@wbamberg
Copy link
Collaborator

wbamberg commented Apr 29, 2021

https://developer.mozilla.org/en-US/docs/Web/API/Window/open is long, rambling, and very out of date. It needs a brave person to work out what a page on this feature should contain in 2021 2022.

@wbamberg wbamberg added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 29, 2021
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! good first issue A good issue for newcomers to get started with. Content:WebAPI Web API docs and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Apr 29, 2021
@jamesaucode
Copy link
Contributor

This seems interesting, if you don't mind a newbie contributor taking a look, I can try to take this !

@chrisdavidmills
Copy link
Contributor

This seems interesting, if you don't mind a newbie contributor taking a look, I can try to take this !

Sure thing @jamesaucode , happy for you to give it a try. Assigned.

Don't hesitate to shout if you need help or want any feedback.

@wbamberg
Copy link
Collaborator Author

This seems interesting, if you don't mind a newbie contributor taking a look, I can try to take this !

That sounds great! As Chris says, please don't hesitate to ask for feedback. Personally in a case like this I'd recommend being bold when it comes to making changes :).

And consider the way we try to have pages organized at the top level - there's some meta-documentation about this here: https://developer.mozilla.org/en-US/docs/MDN/Structures/Page_types#api_reference_subpage . I'm not sure offhand which would be a good page to copy, but usually for API reference pages like this we should have a top-level organization like:

Preamble
H2#Syntax
H2#Description
H2# (can have some custom sections in here, if they really don't fit in description. Maybe something about good practices?)
H2#Examples
H2#Specifications
H2#Browser compatibility
H2#See also

@jamesaucode
Copy link
Contributor

Thank you! Will start working on this after work today :) Will let you all know if I have any questions.

@jamesaucode
Copy link
Contributor

Apologies for the lack of update. I've been working on the overhaul over the last week. I added a Window Proxy page as it's referenced in the window.open() page. #4630

Here are a few questions I have for the maintainers: @wbamberg @chrisdavidmills

  1. There are parts of the page (in particular Window Features and Best Practices)
    that I believe can be almost be completely taken out. That might make the page significantly shorter than it is, will that be a problem?
  2. Since this is an API that's not commonly used anymore, do I still need to go into details?
  3. Is it appropriate to guide users to use something else (e.g a <a></a> tag, a modal), instead of using a popup window (with window.open()?

Thanks

@chrisdavidmills
Copy link
Contributor

Apologies for the lack of update. I've been working on the overhaul over the last week. I added a Window Proxy page as it's referenced in the window.open() page. #4630

Here are a few questions I have for the maintainers: @wbamberg @chrisdavidmills

1. There are parts of the page (in particular [Window Features](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features) and [Best Practices](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#best_practices))
   that I believe can be almost be completely taken out. That might make the page significantly shorter than it is, will that be a problem?

I would say no. I just gave it a flick through, and there is quite a lot of eye-wateringly old fashioned stuff in there. Anything that is just plain wrong, not useful, or even harmful to modern web development, should be removed.

2. Since this is an API that's not commonly used anymore, do I still need to go into details?

As a caveat to the above, I would say that features that are still supported probably need mentioning, at least briefly. I'm not convinced that they need the level of detail that is included in the current window features section.

3. Is it appropriate to guide users to use something else (e.g a `<a></a> tag`, a modal), instead of using a popup window (with `window.open()`?

It is definitely appropriate to mention alternatives that are preferred these days, but the preferred way would be to include a brief mention and then link to other resources that provide more details, and not embed a tutorial on building modals into the document, as it is not of central relevant to the subject in hand. (Sorry if that comes across as painfully obvious, but just wanted to make sure we were clear ;-) )

@dylanosrc
Copy link
Contributor

Hi @wbamberg @chrisdavidmills @jamesaucode,

It looks like this hasn't been discussed in a while... Mind if I shoot my shot? It would be my first contribution, and I might be getting in over my head, but I am feeling brave!

Thanks

@wbamberg
Copy link
Collaborator Author

I'd be very happy for you to have a go at this! I'll try to answer any questions you have and/or review early drafts if you think that would help.

BTW Chris isn't working on MDN any more.

@jamesaucode
Copy link
Contributor

Hi @wbamberg @chrisdavidmills @jamesaucode,

It looks like this hasn't been discussed in a while... Mind if I shoot my shot? It would be my first contribution, and I might be getting in over my head, but I am feeling brave!

Thanks

Im really sorry I forgot I have picked up this task. I have a rough draft locally but I haven't dug deep into the topic. Thanks for picking this up.

@wbamberg
Copy link
Collaborator Author

No worries James, I know how it is :).

wbamberg added a commit that referenced this issue Mar 21, 2022
* Fixes #4583

* Apply suggestions from code review

Co-authored-by: Joe Medley <jmedley@google.com>

* Update files/en-us/web/api/window/open/index.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update index.md

* Removed deprecated UI features

* Restored content

Restored best practices, FAQ and notes sections for later consideration through a new issue. Retained the removal of the tutorials and references sections since links were broken and the tutorials were painfully out of date. (not sure if I restored this correctly, so forgive my naivety if I didn't)

* Apply suggestions from wbamberg review

Co-authored-by: wbamberg <will@bootbonnet.ca>

* responses to wbamberg comments

* Update files/en-us/web/api/window/open/index.md

Co-authored-by: wbamberg <will@bootbonnet.ca>

* Reinstate addition from PR 13648

Co-authored-by: Joe Medley <jmedley@google.com>
Co-authored-by: wbamberg <will@bootbonnet.ca>
@SphinxKnight
Copy link
Member

SphinxKnight commented May 16, 2022

@wbamberg may I ask to reopen this one? I'm updating the French translation (to remove some old macro) vs the English reference and I do agree that the second part (from FAQ or even Examples) definitely needs some work (on which I would really be happy to help in a few days).

Edit: note to self:

  • Remove Fx/Moz outdated specifics
  • Rework examples (at least fixing structure + invalid links)
  • Link to relevant a11y section of HTML Ref
  • Link to LA/HTTP articles for Same-Origin Policy
    • remove any erroneous confusion between domain and origin
  • Add a See also section for third party links (and remove any 404 / HTTP only links)

@wbamberg wbamberg reopened this May 16, 2022
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 16, 2022
@wbamberg
Copy link
Collaborator Author

Thank you @SphinxKnight !

@SphinxKnight SphinxKnight self-assigned this May 16, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 16, 2022
@SphinxKnight
Copy link
Member

I did not forget this one and intend to be back at it in a few days :x

@SphinxKnight SphinxKnight mentioned this issue Jul 8, 2022
3 tasks
@SphinxKnight
Copy link
Member

I guess the PR is kind of ready. I checked the last edits on this page during conflict merge and I think I got them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help!
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants