The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. December 01, 2008, 04:36:38 PM

Login with username, password and session length


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

Posts: 10


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
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 5211


:sniffle: Humor was so much easier before.


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

If I can't be Mr. Root then I don't want to play.
cd1
Rookie
**
Offline Offline

Posts: 10


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
cd1
Rookie
**
Offline Offline

Posts: 10


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
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 5211


:sniffle: Humor was so much easier before.


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

If I can't be Mr. Root then I don't want to play.
cd1
Rookie
**
Offline Offline

Posts: 10


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
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!