Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a website, and offcourse like most websites it loads faster in Firefox.

I want to create some form of a bar, which displays on top of my site, whenever a user without FF enters the site. This bar will say something like "Install FF for better performance etc etc..."

How should I do this? Browser detection I guess, but there are tons of different codes out there. Any code you all know that is more reliable, and better to use?

Btw, does anybody know if I need permission from Mozilla to have such a bar on my website?

Thanks

EDIT: FF IS NOT THE FASTEST BROWSER, I GOT IT!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
350 views
Welcome To Ask or Share your Answers For Others

1 Answer

(Skipping all the arguments on whether what you want to do is a good or a bad thing. Assuming you really like Firefox and want to promote it.)

  1. Use the navigator object to check if the browser is Firefox. navigator.appCodeName, navigator.appName, navigator.appVersion. What you want to do is not a critical part of your website, so you don't need a fail-safe detection method. If it works for over 95% of your targeted users than the method is good.

  2. I doubt you need permission to advertise a free product. Mozilla even encourages you to do so.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...