Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.08 KB

File metadata and controls

34 lines (24 loc) · 1.08 KB
chapter 16
pageNumber 102
description The navigator is a built-in object that provides information about the user's web browser and the user's system. It contains various properties and methods that give access to information about the user's environment, such as the browser's name, version, user agent, language preferences, and more.

Navigator

The window.navigator or navigator is a read-only property and contains different methods and functions related to the browser.

Let's look at a few examples of navigation.

  1. navigator.appName: It gives the name of the browser application

    navigator.appName; 
    // "Netscape"

    Note: "Netscape" is the application name for IE11, Chrome, Firefox, and Safari.

  2. navigator.cookieEnabled: Returns a boolean value based on the cookie value in the browser.

    navigator.cookieEnabled;
    //true
  3. navigator.platform: Provides information about the browser operating system.

    navigator.platform;
    "MacIntel"