Detecting gecko distributions

Discuss building things with or for the Mozilla Platform.
Post Reply
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Detecting gecko distributions

Post by Chris Cook »

Does anyone know how (if it is possible) to use content script to reliably detect a specific gecko based distribution (Firebird specifically) without user-agent sniffing?
aab
Posts: 252
Joined: November 18th, 2002, 11:59 am
Location: Tallinn, Estonia
Contact:

Post by aab »

I hope not. After all thats what why we want standards compliant browsers in the first place - to behave identically in all situations.

UA string is exactly the place what I'd proabably look since this is the only thing (apart from version quirks) various Gecko browsers differ in. I think UA fakers are proabably rare among Gecko users (while wildly popular with "O"ther alternative browser users). UA rewriting proxies are also pretty rare.

YMMV, of course.
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Missing the point of standards

Post by schapel »

aab wrote:I hope not. After all thats what why we want standards compliant browsers in the first place - to behave identically in all situations.


No, standards are not about browsers behaving identically in all situations. Do you want your desktop browser to behave identically to a cellphone browser, or to a browser designed for the visually disabled?

Standards are about marking up content in such a way that a browser can behave in a way that is most appropriate in a given situation. That's why we're moving away from tags that say that text should be bold towards tags that say text should be emphasized. The browser can determine the most effective way to emphasize text, and that will most definately not be identical in all browsers.

The best thing for the health of the web is for so many different kinds of browsers to be used that developers give up trying to test in all browsers. Just mark up the content according to the standards, and let the browsers determine the best way to present that information to the user.
scragz
Posts: 2914
Joined: February 8th, 2003, 2:38 am
Location: San Diego, US
Contact:

Post by scragz »

I was thinking he wanted it for an extension/theme install script (Right Chris?). This would be a permittable use of browser specific code.

As far as an answer, there are other properties and methods of the navigator object besides userAgent. Namely appName, appCodeName, appVersion, and appMinorVersion might be useful for this.
moronicbajebus
Posts: 540
Joined: November 8th, 2002, 8:37 am
Location: Maryland, USA
Contact:

Re: Detecting gecko distributions

Post by moronicbajebus »

Chris Cook wrote:Does anyone know how (if it is possible) to use content script to reliably detect a specific gecko based distribution (Firebird specifically) without user-agent sniffing?
No.

Why do you want to find just Firebird browsers?
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

scragz wrote:I was thinking he wanted it for an extension/theme install script (Right Chris?). This would be a permittable use of browser specific code.

As far as an answer, there are other properties and methods of the navigator object besides userAgent. Namely appName, appCodeName, appVersion, and appMinorVersion might be useful for this.

These properties return meaningless values (like mozilla or netscape?!?) so are obviously either in need of bug fixing or are worthless for my purposes.

aab wrote:I hope not. After all thats what why we want standards compliant browsers in the first place - to behave identically in all situations.

Would you say that installing mozilla specific extensions is a case where standards would apply? If you don't have an answer to my question, then please ignore it.

moronicbajebus wrote:No.

Why do you want to find just Firebird browsers?

For the reason that scragz correctly stated above. It is desirable to prevent mozilla applications from installing a theme or extension that is not supported.

I now realize that this capability will work, and perhaps even belongs in, the XPInstall script. This way only gecko based browsers would need to be detected externally.
User avatar
bdeonline
Moderator
Posts: 1214
Joined: November 5th, 2002, 5:19 am
Location: OK, USA
Contact:

Post by bdeonline »

Hay Chris I found this script that will detect IE4/5/6, Netscape 4/6/7/other Gecko, Konqueror 2.2+, Safari, Opera 5/6/7, but it doesn't seem to work on Firebird but it could probably be altered to. If you can find someone who knows JavaScript.
<a href="http://www.dynamicdrive.com/dynamicindex9/browsersniffer.htm">From Dynamic Drive</a>
User avatar
bdeonline
Moderator
Posts: 1214
Joined: November 5th, 2002, 5:19 am
Location: OK, USA
Contact:

Post by bdeonline »

There is also good info on <a href="http://devedge.netscape.com/viewsource/2002/browser-detection/">Netscape Devedge on detecting Gecko Browsers</a>.
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

bdeonline wrote:Hay Chris I found this script that will detect IE4/5/6, Netscape 4/6/7/other Gecko, Konqueror 2.2+, Safari, Opera 5/6/7, but it doesn't seem to work on Firebird but it could probably be altered to. If you can find someone who knows JavaScript.
<a href="http://www.dynamicdrive.com/dynamicindex9/browsersniffer.htm">From Dynamic Drive</a>

This script uses user-agent sniffing which is not a viable solution (since user-agent strings can be faked).

bdeonline wrote:There is also good info on Netscape Devedge on detecting Gecko Browsers

Its a good page, but unfortunately I am familiar will all the methods described on it.

Object detection would be fine except that all gecko based browsers have identical implementations (which is desirable) which makes detecting a specific distro impossible.

In any case, I will no longer persue this since I believe it belongs inside the install script on not on a web page.
aab
Posts: 252
Joined: November 18th, 2002, 11:59 am
Location: Tallinn, Estonia
Contact:

Re: Missing the point of standards

Post by aab »

schapel wrote:Do you want your desktop browser to behave identically to a cellphone browser, or to a browser designed for the visually disabled?


I want all cellphone browsers behave identically in identical environment and all visual browsers behave identically in identical environments. Gecko based visual browsers should behave similarily in any given situation. That's the whole point of using unified engine, is it not?

Chris Cook wrote:Would you say that installing mozilla specific extensions is a case where standards would apply? If you don't have an answer to my question, then please ignore it.


I think we're killing a sparrow with a cannon here. Why not let people choose which link they click? There is no need to try to rely on quirks/strings/whatever for detection which might fail with next release or build because quirks get ironed out and strings changed.
scragz
Posts: 2914
Joined: February 8th, 2003, 2:38 am
Location: San Diego, US
Contact:

Post by scragz »

You should put in a bug for that to be part of the XPInstall object.
User avatar
avih
Posts: 347
Joined: December 30th, 2002, 2:36 pm
Contact:

Post by avih »

Chris Cook wrote:
moronicbajebus wrote:No.

Why do you want to find just Firebird browsers?

For the reason that scragz correctly stated above. It is desirable to prevent mozilla applications from installing a theme or extension that is not supported.

I now realize that this capability will work, and perhaps even belongs in, the XPInstall script. This way only gecko based browsers would need to be detected externally.


that's a bad idea. for exactly such reasons , 'smart' developers prevent 'netscape' browsers from accessing their content, eventhough the newer ones (i.e. moz/px/fb) do usually display the pages well.

i would suggest only displaying a warning during the installation procedure that 'this extension was not tested with your browser. installing it may lead to execpected results. would you like to install it anyway?' . this way you leave the decision to your users. you don't like changing the UA string, do u? handle your users with respect.
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

avih wrote:that's a bad idea. for exactly such reasons , 'smart' developers prevent 'netscape' browsers from accessing their content, eventhough the newer ones (i.e. moz/px/fb) do usually display the pages well.

i would suggest only displaying a warning during the installation procedure that 'this extension was not tested with your browser. installing it may lead to execpected results. would you like to install it anyway?' . this way you leave the decision to your users. you don't like changing the UA string, do u? handle your users with respect.

You raise a good point. However, it is not web pages with "content" we are talking about but application extensions. While I would agree that for much of the life of the mozilla project, the various mozilla applications (mozilla, netscape, and perhaps others) have had sufficiently similar implementations to allow that most themes and extensions would work with all of them to varing degrees.

Firebird and Thunderbird bring a quite different implementation to the table though with "toolkit" which means that this commonality can no longer be relied upon. Therefore, my Luna theme will NOT work to any degree in any other mozilla application that does not support the "browser" component, regardless of how polite I would like to be to its users. Yes, this could change in the future as additional applications make use of the "toolkit". Therefore, perhaps interface sniffing (similar to object sniffing in DOM) would serve the purpose. There SHOULD obviously be a better way though or it should be handled automatically by XPInstall.

Of course I could just throw caution to the wind and allow users to fend for themselves as everyone seems to suggest. The forums pay the price though when people come to ask how to clean up the mess they've made installing an unsupported extension.
User avatar
avih
Posts: 347
Joined: December 30th, 2002, 2:36 pm
Contact:

Post by avih »

@Chris Cook:

imho, you as a user would have preferred to have the option to try it or trash it. i know i would, and who knows, if i'm in an experimental mood, i might have tried installing it anyway. i've already had clean installs so many times. so have many others.

making decisions for your users without letting them override your 'intelligent block' is imho undermining the intelligence of your users, which of course, most of them aren't programmers, but neither complete jerks. hopefully.

here are some reasons why letting users choose is better:

1. the UA block is a good precedence for an action which might have been seen 'smart' and 'helpful' for users at the time, to prevent them the disaster of browsing their pages with 'incompatible browser'. not very long ago there was a link (on this forum iirc) to a page on MS site (media player or something similar iirc) that wouldn't allow NON-IE browser access the pages. not even try. that's a good precedence to keep in mind.

2. the name of 'our' browser may change in the future. it has already changed, new variants showed up. some compatible some are not.

3. your detection paradigm might work extremely well today, but can u be 100% sure it's gonna distinguish between 'really supported' browsers and 'really unsupported' ones in the future?

4. imagine a program written in 1996 to take advantage of the 'new' features of win95, and won't work on win3.11. then came win98, but alas, the program didn't recognize it as a newer version. it only identified ("this windows" != "win95) therefore it's "incompatible". you see where such paradigm can lead? there are more similar examples.

5. and most important, you give your users the choice to either try it or leave it alone.
User avatar
gemal
Posts: 223
Joined: November 7th, 2002, 3:49 am
Location: Copenhagen, Denmark
Contact:

BrowserSpy gecko detection

Post by gemal »

Henrik Gemal
Mozilla Evangelist
Post Reply