mensus.net - Interrogating your browser

 
Create Account – Sign in
The "Browser Revealed" page shows the data your browser sends to the server every time you request a webpage. Web pages can interrogate your browser even further using javascript and VBScript. Although there is a standard not all browsers implement it correctly. This page will show you some of the information that is available to webpages.

The Good

Using some simple javascript objects and fields a webpage can use the following information:

Javascript ObjectYour Browser returnsDescription
navigator.userAgent Contains the browser type and version, and often also information about the OS.
navigator.appName Contains the browser name (some browsers lie).
navigator.appVersion Version number of the browser.
screen.width The width of your screen.
screen.height The height of your screen.

The Bad

Some objects and fields exist in different browsers, but are named differently. So in order to access them the website first needs to find out which browser its running on, and then select the correct version.

Size of the browser window

Different browsers offer different way to read that information. They usually do not account for the scrollbars either, so you have to take that into account if you want to use those numbers.

BrowserJavascript ObjectYour browser returnsDescription
Everything but Internet Explorerself.innerWidth
window.innerWidth
self.innerHeight
window.innerHeight
The width of the windows.
Subtract 16 to account for scroll bars in Mozilla.
Internet Explorerdocument.body.offsetWidth
document.body.offsetHeight
The width of the windows. Subtract 20 to account for scroll bars in Internet Explorer.
Internet Explorer in strict modedocument.documentElement.offsetWidth
document.documentElement.offsetHeight
The width of the windows. Subtract 20 to account for scroll bars in Internet Explorer.

Total height of the page

Here it gets even more complex, as there are several different ways to get those numbers, and most browsers support all those objects and fields, but return different values. In some cases the value actually changes while the page is loaded. Your best bet is to find out which value is the larger one and use that one. You also should only read them after the complete page has been rendered by the browser.

Javascript ObjectYour browser returns
document.body.scrollHeight
document.body.scrollWidth
document.body.offsetHeight
document.body.offsetWidth
Here the same table again, compare the numbers with the ones you got above to see if they change in your browser (those are highlighted in red).:

Javascript ObjectYour browser returns
document.body.scrollHeight
document.body.scrollWidth
document.body.offsetHeight
document.body.offsetWidth

The Ugly

Web pages would like to query the browser to find out what plugins are installed. While mozilla and compatible browsers make this quite easy Internet Explorer makes it very hard. Even worse: web designers need to create pages that work in all kinds of browsers, which is far from trivial. If you have a mozilla compatible browser the table below lists all your plugins:

You can also get a list of all file types (or, more correctly the MIME types supported):

For more details and how to work with Internet Explorer please check Detecting Flash with Javascript.

Comments regarding this page

Use this feature to comment on this page, to suggest features, ask question or propose changes. Comments are shown in a threaded format, with newer comments at the top.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
You need to signin if you want to post a comment

Privacy Policy   —   Terms of Use Agreement   —   © 2006 - 2017 mensus.net