Closed Bug 230914 Opened 21 years ago Closed 16 years ago

Behr website incorrectly detects Mozilla vendor strings as non-mozilla browser

Categories

(Tech Evangelism Graveyard :: English US, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: thomas.duffy.99, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Epiphany/1.0.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Epiphany/1.0.4

The Behr website tries to detect the browser version and gets it wrong if the
vendor string is set to anything other than Mozilla.  This is the case on any
browser using Gecko like Firebird, Epiphany, or Galeon.  But this also breaks
stock Mozilla on Debian which sets its vendor string to Debian.

The code in question is this:
   // See if Colorsmart can be accessed
   function launchColorSmart (type, entryView) {
	if ((is_ie5up) || (is_nav6up) || (is_moz5up) || (is_opera5up) || (isSafari)) {
	     flashColorSmart(type, entryView);
	}
	else {
	     popUp('/behrx/includes/getBrowser.jsp','getBrowser','400','285','no');
	}
   }

if it thinks you are not using moz5 or netscape6 and higher, it won't let you
use the color picker.  Here is the browser detection code from
http://www.behr.com//includes/browser_detect.js:

    var is_gecko = !isKonqueror && !isSafari && (agt.indexOf("gecko/") != -1);
    var is_gver  = 0;
    if (is_gecko) is_gver=navigator.productSub;
    
    var is_moz   = ((agt.indexOf('mozilla/5')!=-1) &&
(agt.indexOf('spoofer')==-1) &&
                    (agt.indexOf('compatible')==-1) &&
(agt.indexOf('opera')==-1)  &&
                    (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) 
   &&
                    (is_gecko) && 
                    ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
    var is_moz5up = (is_moz && (is_major >= 5));
    if (is_moz) {
       var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
       if(!(is_moz_ver)) {
           is_moz_ver = agt.indexOf('rv:');
           is_moz_ver = agt.substring(is_moz_ver+3);
           is_paren   = is_moz_ver.indexOf(')');
           is_moz_ver = is_moz_ver.substring(0,is_paren);
       }
       is_minor = is_moz_ver;
       is_major = parseInt(is_moz_ver);
    }

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
                && (!(is_moz)));

    // Netscape6 is mozilla/5 + Netscape6/6.0!!!
    // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
    // Changed this to use navigator.vendor/vendorSub - dmr 060502   
    // var nav6Pos = agt.indexOf('netscape6');
    // if (nav6Pos !=-1) {
    if ((navigator.vendor)&&
        ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
        (is_nav)) {
       is_major = parseInt(navigator.vendorSub);
       // here we need is_minor as a valid float for testing. We'll
       // revert to the actual content before printing the result. 
       is_minor = parseFloat(navigator.vendorSub);
    }

You will note that unless the vendor string is Mozilla or Netscape, it won't
detect properly.  You can of course work around this by making your user agent
look like IE or Netscape 6.


Reproducible: Always

Steps to Reproduce:
1. try to use the color browser on Behr's website
2. it says you must use Netscape 6 or IE 5

Actual Results:  
Doesn't detect a compatible browser even though it should work.

Expected Results:  
Should detect a gecko capable browser and allow access to that part of the site.
Seems to work fine now in both Camino trunk and Firefox. Comment 0 is proof enough that this should have been confirmed at some point, so marking FIXED and blocking bug 334967 for historical purposes.
Blocks: geckoisgecko
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.