window.navigator property exposed by browsers points to a Navigator object which is a container object that makes a lot of Web Platform APIs available to us.
The standard and widely implemented properties include:
cookieEnabledtrue if cookies are enabled
geolocationpoints to the
Geolocationobject used by the Geolocation API
languagereturns a string representing the language currently active in the browser
onLinereturns true if the browser is online (the browsers interpret this in different ways, be aware)
ServiceWorkerContainerobject assigned to the document (see Service Workers)
userAgentthe name of the User Agent identifier of the browser
The standard methods include:
registerProtocolHandler()a way to let websites register as handlers for protocols.
There are many more methods and properties which are provided by APIs that are either experimental or implemented as drafts and not yet finalized, or just available on a tiny fraction of browsers, so I haven’t included them here but you can explore them all on MDN.
More browser tutorials:
- The Complete Guide to Progressive Web Apps
- The Push API Guide
- The Fetch API
- Why use a preview version of a browser?
- How to remove all CSS from a page at once
- Web Workers
- How to remove all children from a DOM element
- How to make a page editable in the browser
- How to change a DOM node value