Open foolip opened 3 years ago
Also, I think as titles (not slugs), as well as links we should use navigator.xyz
(with a lowercase)
I agree with that, but it is a policy which is tricky to draw the line for. history
, performance
are other case where it's probably a good idea and uncomplicated, but how about:
crypto.subtle
which is a SubtleCrypto
instance (maybe good?)document
which is usually a HTMLDocument
but not always (not a good idea)indexedDB
which is a IDBFactory
instance (maybe good?)localStorage
+ sessionStorage
which are Storage
instances (not a good idea)navigator.mediaDevices.*
for the MediaDevices
members (maybe good?)console
is probably a good idea too. (I wasn't suggesting to do this for all cases)
For console
there is no debate, the actual name of the namespace is lowercase "console", not "Console". I'd like to see this changed in BCD and MDN :) It's just a little bit awkward as noted in https://console.spec.whatwg.org/#console-namespace the naming is for historical reasons, and will forever be an odd one out unless another mishap occurs.
Not sure if it is useful for the cases discussed here but a while ago we introduced "global" pages:
https://developer.mozilla.org/en-US/docs/Web/API/fetch https://developer.mozilla.org/en-US/docs/Web/API/crypto_property
In BCD, they are stored here. https://github.com/mdn/browser-compat-data/tree/main/api/_globals (See the mdn_urls in the files for a full list of such global pages)
Maybe the same could be done with the remaining properties this issue discusses.
https://github.com/mdn/browser-compat-data/issues/9125 is a long discussion about the peculiar cases of
Location
+WorkerLocation
andNavigator
+WorkerNavigator
, which are the only APIs on the web platform where distinct interfaces are used to represent the "same" thing in window and worker contexts.For example,
navigator.userAgent
is available in both window and worker contexts, butnavigator
itself is a different kind of object. (This difference rarely matters in practice.)BCD will follow the structure of specs/implementations, but on MDN there's duplication that might be possible to avoid. These pairs of pages and their subpages should be considered for merging or cross-linking:
For
location
it's probably best to keep them separate since the worker variant is read-only. Butnavigator
it's hard to see the usefulness of splits like this: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/languages https://developer.mozilla.org/en-US/docs/Web/API/Navigator/locks https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/locks