The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 05:37:32 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Javascript Browser Detection  (Read 3265 times)
cd1
Rookie
**
Offline Offline

Posts: 16


View Profile
« on: October 07, 2008, 07:08:01 PM »

Does anybody know of any techniques or quirks in javascript that would allow more reliable detection of the remote web browser than just using user-agent ? Basically, I would like to be able to detect IE vs. Firefox vs. Safari via Javascript and compare whether the browser acts like the browser that the user-agent claims to be.
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: October 07, 2008, 07:15:33 PM »

There are about a bazillion of these out there.

Start here: http://www.google.com/search?client=safari&rls=en-us&q=ultimate+javascript+client+sniffer&ie=UTF-8&oe=UTF-8
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
cd1
Rookie
**
Offline Offline

Posts: 16


View Profile
« Reply #2 on: October 07, 2008, 07:34:01 PM »

Thanks for the links Perkiset. 

I've looked at most of these before, but all I have found rely on  navigator.useragent or browser.useragent, and then parse it out.  I'm using firefox on linux, but have set my user-agent to IE6 on XP, and haven't found a script yet that will tell me that I'm not really on Windows or using IE.

Maybe some ActiveX detection or something similar might work.  Any ideas?
Logged

No links in signatures please
cd1
Rookie
**
Offline Offline

Posts: 16


View Profile
« Reply #3 on: October 07, 2008, 07:40:49 PM »

I just found this:
Code:
var isMSIE = /*@cc_on!@*/false;
Apparently, it uses javascript conditional compilation that will evaluate to true on IE.
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: October 07, 2008, 09:23:10 PM »

If it's that simple, then you'll like this - it's what I do all the time:

var isIE = ((document.all) && (document.getElementById));

That'll do ya.

But perhaps if you outlined a little more about what you're looking for, it'd be easier to assist you. Are ... um ... penetration testing? Are you trying to write Ajax apps?


Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
cd1
Rookie
**
Offline Offline

Posts: 16


View Profile
« Reply #5 on: October 08, 2008, 12:20:17 PM »

Let's just call it "browser content delivery", similar in concept to "IP delivery".

So does anyone have any ideas for positively identifying firefox or safari through the same type of javascript tricks?  Possibly accessing firefox chrome:// with js or something similar. I have no clue where to start w/ safari.
Logged

No links in signatures please
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!