Course Content

  • 4.4 navigator

Course Content

Javascript BOM - Navigator object


Java script Dom- Navigator Object


Hello guys welcome to our series Java script.

In our last segment we saw about history object in Javascript,

if we open more than one URLs in any tab of browser or we open any website that time also those URLs get stored in History Object,

through history object, we can go through all the previous and next URLs,

so we can check forward and previous URLs with the help of History,

and if we have to visit any URL directly then that also can be done through history objects.

I hope you have practiced all practical from the last segment.

Let’s move further with our today’s segment, our today’s segment is based on navigator objects,

Now, what is a navigator?

 Navigator objects provide us with lots of details about our browser,

when we work with a browser's URL, like how many URL’s are opened and all for that we have a history object.

If we want any browser related data then we can get that through our navigator object, navigator object is basically used for detection of browser’s properties, characteristics or details.

So, if we are getting any data through navigator object then we get information related to browser,

like appname, appCodename, userAgent etc.

we can use navigator object in similar manner as that of history object and window object.

We can either use window dot navigator or we can use navigator object directly.

We have few properties of navigator object, like as you can see here in table,

appName, appVersion, appCodeName, if cookies are enabled or not, what is the user agent?, which language it supports? etc.,

We are going to see all these properties today.

So, I request you to pay attention, okay ! good!


Navigator object does not have any methods,

We have only two methods with help of that we can check whether Javascript is enabled or not or we can check whether taint is enabled or not.

Mostly in web applications, we do not use many methods of this object, but if we want browser related details then that we can get through the navigator object.

To understand all the properties that are shown here, we will perform a practical,

so that we will get a better understanding.

(writing program ; be slow)

So first, we will open sublime text, in sublime text html,

(8 seconds pause ; typing)

script. save,

now in this, we have to get details from browser through navigator,

first,(7 seconds pause ; typing) we will add a header,( 5 seconds pause ; typing)

navigator (4 seconds pause ; typing) object properties,

and after that we will write all our properties in this,

first property in document dot writeln, first is app Name,

so here we will write app…Name, navigator dot appName,

That’s it !

If we have written navigator appName,

As you can see this is not a method so we have not added brackets, this is a constant value so we will simply write app name like this, and after plus and we will add br, save this and we will run this program….



So you can see here when I am searching appName I am getting Netscape as my answer,

first we will check everything on chrome browser and then we will jump on other browsers,

(writing program ; be slow)

after appName comes our second property appVersion, save and reload,

so you can see here we can see version window NT 10.0 win64, so we can see our browsers version here,

after that appCodename.

and here Mozilla is returning to us,

after that cookie enabled, (7 seconds pause; typing).

so true because currently in our browser cookies are enabled, (4 seconds pause ; typing)

after cookiesenable we have useragent, (9 seconds pause; typing)

in useragent, we are getting same answer as our appversion,

after useragent, we have language and in that we are getting en-GB means English GB,

after language we have user language, (7 seconds pause; typing)

undefined so that means in our browser currently no language is defined,

after userlanguage we have plugins…

so in plugins we are getting object plugins array means whatever array of plugins we have is returning to us.

After plugins, we have systemlanguage,(4 seconds pause ; typing)

and along with systemlanguage, we have mimeTypes.(pronounce ; ma - i -m)

which returns us array, (6 seconds pause ; typing)

so systemlanguage is undefined and un mimetypes an object is returning to us,

array object,

last two are platform, (7 seconds pause; typing)

In platform, we are getting windows 32 so if you want to know which is your current window platform then you can check that with the help of navigator object and

last is online, (4 seconds pause; typing)

 and in that we are getting undefined.


Now, you might think that all this data which we got,

So from where we got this?

All these data is either system related or browser related.

So some things are acquired directly from browser and some things we get from system, like platform an all are our browser related data.

If I run this same program… in Microsoft edge…

so here you can see in appName,

we are getting netscape,

in version we are getting same answer, after that appCodeName Mozilla, cookies enabled true, user agent is also same,

you can see in chrome we are getting language en-GB (pronounce: e - n - gb)whereas here we are getting en-US means this data is browser dependant,

then, we are getting plugins,

Again system language undefined.

so our last properties are browser related where we are getting browser related output.

 understood so far!

So you can see, navigator object gives us output related to browser,

when we develop web application, we don’t use navigator much because we have to run our program our application in browser,

we take browser related data when we are developing such application where we might have to show browser related data,

but majorly, we create such applications which are browser independent because we create such applications which can run in all browsers properly.

we don’t check in only one browser,

that’s why navigator object is used less,

but if you are asked questions from interview perspective like what is you current system which windows are installed, windows 32 or windows 64,

which operating system do you have? Etc.


If questions like these are asked,

you can answer as navigator object like we can pass all system related data through navigator object,

in navigator we have only 2 methods,

first is Java enable to check whether Java is enabled or disabled in our system,

and second is taint enable,

taint enable method has been removed since Java version 1.2 has arrived only Java enable method is still there.

So if we have to check that,

how can we do that?

If we have to check whether Java language is enabled or not in our system then what will we do?

(12 seconds pause; typing)

So here, navigator dot Java enabled and this is the method.

so we will add parentheses, Save and reload,

check if Java is enabled. So here we are getting False,

it means in our system, Java is not enabled.

Here you can see, if J D K was installed in our system.

then, it would appear in our tray also, which means in my current system J D K is not installed that’s why we are getting Java enabled as false.

Our last method is,...

 check if taint is enabled or not?

(5 seconds pause ; typing)

So for that as I have already said taint has been removed after the arrival of Java 1.2,

so that’s why this program will not run and,

we are getting an error that taintEnabled is not a function as this method has been removed.

So how many methods are accessible to us in navigator?

One method i.e. Java method, means Java enabled like whether Java is installed or not, taintenabled has been removed after arrival of Java 1.2.

I hope you are clear.

So guys this was our today’s segment, in which we saw navigator object,

it is very simple to understand navigator object,

it has very few properties and we have only method and that is also not used for executing anything,

we only get if Java is enabled or not, we get all systems related and window related data from navigator object.

If you have any queries or comments, click the discussion button below the video and post there. This way, you will be able to connect to fellow learners and discuss the course. Also, Our Team will try to solve your query.

Understanding navigator objects is very easy because this is not used much even in the practical world it is used very remotely.

In our next segment, we will see the Browser Object Model’s screen object.

Thank you.

(video duration- 13 minutes 25 seconds)

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere