Firefox version "2.0.0.6" not detected
After my email (which follows) had been submitted,
:: Quote :: Thanks for your interest. However, do not expect any answer any time soon, since posting in the forums is really how we prefer to answer questions.I want to make www.neilmix.com/2007/02/07/threading-in-javascript-17/ fail fast for other browsers (than FF2+), but this: :: Code :: <?php
require "browser.php";//your full-featured script $browser = browser_detection('full'); foreach($browser as $i) echo "$i<br>\n"; ?> :: Quote :: moz
1.8 1 1 nt 5.1 gecko bro 1.8 Back to top |
|||||
I can't remember off the top of my head how to get the version number. That's because the primary purpose of the script is to get actual funcionality, not the cosmetic version numbers.
For that functionality, the gecko rv version is the actual thing you test for, in this case, gecko rv 1.8 is the gecko engine. This bypasses all the different flavors of gecko powered browsers and ids, like firefox, iceweasel in debian, epiphany, and so on. You can check out the mozilla specific return values, look in the computer information script on the browser detection page for an example of how to do that. But remember, comparing numbers like 2.0.0.6 with other numbers is very unreliable and prone to failue due to differences in versioning numbers of different firefox/gecko flavors. Back to top |
|||||
OK, thanks. Would you happen to know the earliest supporting Gecko version?
Back to top |
|||||
From what I can remember, the first gecko was, I think, 0.6
Then 0.9 was Netscape 6 with some tweaks, back when netscape and mozilla were actually technically different internally. I think also possibly Galeon browser, based on the gecko engine, may not use the same rv system, which makes it even more painful. Happily, almost nobody uses galeon. Back to top |
|||||
You lost me. To ask it a clearer way, what's the earliest Gecko to support JavaScript 1.7?
Back to top |
|||||
I found I think just what you are looking for at wikipedia
Scroll down the page until you get to 'Version correspondence', that shows precise gecko rv engine support. :: Quote :: 1.7 (Gecko 1.8.1, Firefox 2, October 2006)however, you'll notice that: :: Quote :: 1.6 (Gecko 1.8, Firefox 1.5, November 2005)As you see, 1.7 support was added in a subversion of 1.8, 1.8.1 Which means you have to do more scripting to handle precise detections. However, in my opinion, this is always a bad method to use. FAR BETTER is to find a javascript method or function that you need to have support for, then to implement an inititlal test of that method, with an alternate option for browsers that do not support that method. This is how I always handled netscape 4 things in the past, I would wrap all my stuff up in conditionals: :: Code :: if ( ! document.layers )
{ <execute advanced code for newer non netscape 4x browsers } else { <execute safe defaults, or whatever> } So all you need to do is find a single javascript/ecmascript 1.7 specific method or feature, test for that, and then escape if not supported, and i you also need to make sure it's a gecko browser, simply test for gecko support as well, like: if ( some.method && isGecko )..... Back to top |
|||||
Hmm... <script type="application/javascript;version=1.7"> isn't recognized in Opera/IE6, so I can set a variable inside it and detect support by that variable. Thanks!
Back to top |
|||||
All times are GMT - 8 Hours
|