Re: Selecting for features

On Mon, Jul 12, 2010 at 12:21 PM, Garrett Smith wrote:

> > At a glance, Modernizr appears to create a few closure-based
memory leaks...

Thanks for the look, Garrett. I plan to ask CLJ for a code review soon. I'd
like to get that set of eyes on the library.



>> Modernizr currently relies on super-trivial checks for some features
>> *because it works*.

> Precisely. Basic boolean feature detection already works.

Yeah as the source indicates, something like !!navigator.geolocation is as
easy as it should be.
But then disabling cookies, privacy configuration settings and
private/incognito modes make checking something like sessionStorage or web
SQL a lot less straightforward.

We'll keep Modernizr up to date with the quirks that browsers throw us (fair
and unfair), making it easy for authors deal with a straightforward
boolean. I'm personally committed to keep Modernizr's results accurate and
then bitch at vendors when they make they expose feature false positives :)
(For example: touch events, registerProtocolHandler in Chrome, HTML5 input
types in safari 5, flexbox in ie9)

Also, we would love to see people use just the discrete tests from within
Modernizr, without the rest of the library if that's what they need.

Received on Monday, 12 July 2010 21:18:33 UTC