2
votes

I want to detect whether a visitors browser is capable of running famo.us - if not redirect them.

My first thought was Modernizr and detect whether the browser is capable of CSS 3D transformations, though i'm worried that this may be too severe as famo.us is adding some backward compatibility perhaps through shims.

I'm currently using WURFL for device detection, though this doesn't give enough browser information as far as i can tell.

Any thoughts on this?

2

2 Answers

4
votes

The standout feature that famo.us depends on is CSS preserve-3d which is key to doing CSS 3D transforms and what famo.us depends on to render correctly.

You can use the cutting edge 3.0 beta of Modernizr to test for this support specifically. I'd recommend using it over reading the User Agent, as you'll always get weird false positives somehow. Using the current 2.x release will not work, as testAllProps won't support the two parameter syntax.

if(Modernizr.testAllProps('transformStyle', 'preserve-3d')){

    //true
    // run famo.us code!
}
else
{
    //false
    // famo.us 3d transforms won't work right, so lets compromise
}

There's been quite an effort to track this one on the Modernizr teams part, so if you find any issues, let them know here.

0
votes