Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detecting Firefox as the browser in javascript

0 views
Skip to first unread message

YMIYRU_04

unread,
May 4, 2004, 8:18:35 PM5/4/04
to
Does anyone have javescript code that determines that the current
browser is Firefox?

Michael Lefevre

unread,
May 4, 2004, 8:53:40 PM5/4/04
to
On 2004-05-05, YMIYRU_04 <tcl...@CloseEncounter.com> wrote:
> Does anyone have javescript code that determines that the current
> browser is Firefox?

You can see some if you look at the source of Ben Goodger's (lead Firefox
developer) blog. http://www.bengoodger.com/weblog/

Basically you look for "Firefox" in the user-agent:
if (navigator.userAgent.indexOf("Firefox") == -1) {

--
Michael

Ron

unread,
May 4, 2004, 9:09:09 PM5/4/04
to
YMIYRU_04 wrote:

> Does anyone have javescript code that determines that the current
> browser is Firefox?

Also, by experimentation "Firefox" is the navigator.userAgent.vendor
string. :)

PeEmm

unread,
May 5, 2004, 5:08:32 AM5/5/04
to

Ron

unread,
May 5, 2004, 11:14:42 AM5/5/04
to
PeEmm wrote:

Bad typo. I meant navigator.vendor, not userAgent.vendor. :)

0 new messages