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

Make sure pages for features on WindowOrWorkerGlobalScope describe the correct means of accessing #2427

Closed
13 tasks
jpmedley opened this issue Feb 17, 2021 · 2 comments
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@jpmedley
Copy link
Collaborator

Best described with Philip's quote from #1940. This issue is about making soure the descriptions are clear. It takes no position on the suggestion to put the referenced items under Global_Obects/.

For all of the methods on WindowOrWorkerGlobalScope, I believe invoking them directly as fetch() rather than self.fetch() is idiomatic. They are: atob(), btoa(), clearInterval(), clearTimeout(), createImageBitmap(), fetch(), queueMicrotask(), setInterval(), setTimeout().

For attributes, while they can be accessed directly, I think for at least these it's more idiomatic to access them via the global object, because it makes it clear they're not local variables: self.crossOriginIsolated, self.isSecureContext, self.origin.

Then there's caches and indexedDB, where I suspect there's more variation in style. I'd certainly write indexedDB.open(...), but the example uses window.indexedDB.open('toDoList').

On the URL, another option would be /api/Global_Objects/fetch, more analogous to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

I think that looking at the members of Window and WorkerGlobalScope will reveal more tricky cases. I think especially a method like window.resizeTo(), which it can be invoked as just resizeTo(), would not be great to give the same treatment as fetch().

Here's the start of a list. I do not claim it is complete.

  • atob()
  • btoa()
  • clearInterval()
  • clearTimeout()
  • createImageBitmap()
  • fetch()
  • queueMicrotask()
  • setInterval()
  • setTimeout()
  • crossOriginIsolated
  • isSecureContext
  • origin
  • resizeTo
@Rumyra Rumyra added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help! documentation and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jun 7, 2021
@github-actions github-actions bot added the idle label Dec 8, 2021
@teoli2003 teoli2003 reopened this May 29, 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 29, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 30, 2022
@sideshowbarker
Copy link
Collaborator

Closing per #2427 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

6 participants