<![CDATA[Offical Modernizr.com Blog]]>https://modernizr.comhttps://modernizr.com/img/logo.pngOffical Modernizr.com Bloghttps://modernizr.comRSS for NodeMon, 05 Mar 2018 02:59:49 GMT1440<![CDATA[Modernizr 3.5.0]]>Instead of quietly updating the library like we did for our 3.4.0 release (yes, that happened — see the full changelog here), we have an exciting new feature detect as part of 3.5.0: CSS Grids!

With browsers adding support for CSS Grids in their latest releases, the time to start using CSS Grids is truly here. Just one caveat: IE11 and current shipping versions of Edge do not support the new syntax, but _do_ support the old legacy CSS Grids proposal—and only one of them supports, uh, @supports.

So in 3.5.0 we’re adding two tests in one: the now-standard official CSS Grid syntax as Modernizr.cssgrid, and the old proposal’s syntax as Modernizr.cssgridlegacy. There is also an additional polyfill available for the Pointer Events test, named PEP. Lastly, dependencies were updated.

Happy developing!

New Feature Detect(s)

Updated

Updated Dependencies

  • Update grunt-contrib-clean to version 1.1.0 🚀 #2188
  • Update yargs to version 7.0.2 🚀 #2175
]]>
https://modernizr.com/news//news/modernizr-3-5-0https://modernizr.com/news//news/modernizr-3-5-0Faruk Ateş]]>Thu, 13 Apr 2017 00:00:00 GMT
<![CDATA[Modernizr 3.4.0]]>After a long silence, and slowed work (I had a baby!), the team is back at it again with Modernizr 3.4.0!!!

Fixed

Updated

  • @Rowno updated the build URL to use https instead of http for links - #1865
  • @patrickkettner updated the IndexedDB detect to be more fine grained with feature detection - #2030
  • @patrickkettner added the alias svgincss for svgasimg - #2031
  • @paulirish inverted the internal logic of the transformstylepreserve3d detect to make it more readable - #1920
  • @patrickkettner updated a few tests to not use the Boolean constructor - #2049
  • @camjc removed some duplicat entries from the config-all file - #2066
  • @LaurentBarbareau updated support detect metadata to have a valid url - #2097
  • @whawker updated the localizednumber test - #2093
  • @PikadudeNo1 updated the fontface detect to remove old android due to very low usage - #2095
  • @JaZo updated the indexeddbblob detect to ensure the puts are successful - #2102
  • @philippevk updated the es6 string detect to check for includes instead of contains - #2136

Added

Updated Dependencies

And finally, a big big thank you to Ryan Seddon for pushing this release through!

]]>
https://modernizr.com/news//news/modernizr-3-4-0https://modernizr.com/news//news/modernizr-3-4-0Patrick Kettner]]>Wed, 15 Mar 2017 00:00:00 GMT
<![CDATA[Modernizr 3.3.1]]>What a difference a day makes - we found a couple glaring bugs recently, and so we are releasing 3.3.1 right on the tail of 3.3.0

Fixed

  • @a.shevchenko fixed an issue where the indexeddb check threw an error when cookies are blocked in Firefox - #1831
  • @patrickkettner fixed an issue where multiple build() calls in quick succession caused contaminated builds - #1832
  • @JaZo fixed a typo preventing an indexedDB subtest from ever runnning - #1834
  • @patrickkettner fixed an where the cli version of modernizr would crash when using the inline feature-detect flags - #1839

Updated

  • @alrra updated a bunch of documentation links to https - #1838

Updated Dependencies

]]>
https://modernizr.com/news//news/modernizr-3-3-1https://modernizr.com/news//news/modernizr-3-3-1Patrick Kettner]]>Thu, 14 Jan 2016 00:00:00 GMT
<![CDATA[Modernizr 3.3.0]]>After a long holiday hiatus, its a brand new year, and therefore time for a brand new release from Modernizr!

Fixed

  • @mems fixed the mp3 audio detect for Firefox by adding the proper codec - #1740
  • @niksy fixed an issue where the flash detect could add a fake body when it didn't need too, which screwed up IE 8 (R.I.P.)- #1740
  • @jnordberg fixed the dependency ordering for requirejs on the css filters detects (whoops!) - #1744
  • @mstrutt fixed a false negative issue in nth test - #1757
  • @akamike fixed an issue where setClasses was not being included despite being added via config - #1772
  • @patrickkettner fixed a handful of errors that cropped up in older browsers in 078aea
  • @aFarkas fixed a regression in the input type=number detect in 695fd5
  • @ryanseddon fixed base64 video used in the video autoplay detect, which was causing false negatives in some browsers - #1795
  • @patrickkettner fixed an issue where custom tests weren't allowed to be passed into the buildQuery function - #1801
  • @aakoch fixed a typo in the xdomainrequest detect - #1803
  • @alexgibson fixed false positive in Notifications test for Chrome on Android - #1813
  • @rowanthorpe fixed the syntax for form validation to allow it to run in XHTML mode - #1824

Added

Updated

Updated Dependencies

]]>
https://modernizr.com/news//news/modernizr-3-3-0https://modernizr.com/news//news/modernizr-3-3-0Patrick Kettner]]>Mon, 11 Jan 2016 00:00:00 GMT
<![CDATA[Modernizr 3.2.0]]>Like sands through the hourglass, so are the days of our lives, so is the release of Modernizr 3.2.0.

Fixed

Added

Updated

Updated Dependencies

]]>
https://modernizr.com/news//news/modernizr-3-2-0https://modernizr.com/news//news/modernizr-3-2-0Patrick Kettner]]>Thu, 29 Oct 2015 00:00:00 GMT
<![CDATA[Modernizr 3.1.0]]>We promised faster releases - and here they are. Modernizr 3.1.0 is a pretty small release, but none the less useful.

Fixed

Updated

Added

]]>
https://modernizr.com/news//news/modernizr-3-1-0https://modernizr.com/news//news/modernizr-3-1-0Patrick Kettner]]>Mon, 05 Oct 2015 00:00:00 GMT
<![CDATA[Modernizr 3: A new release and website]]>After what appears an eternity to us and the wider development community we are ecstatic to announce the release of Modernizr 3.0! This is a massive release and from our last release almost 2.5 years have passed - an unacceptable timeline. We plan to fix this and have faster releases where it makes sense.

What's new and exciting?

A lot! We restructured how we write our detects. we no longer have the concept of core tests, and we redesigned and built the site from the ground up to give the website a refresh as well as make the builder a whole lot more powerful for beginners and advanced users. From just creating a simple build to grabbing a config, to implementing in your build process, through to a really cool solution of dynamically creating a custom package that can be installed via bower.

Along with this internal restructure, we’ve added over 100 new detects by the community!

Modernizr changes:

The internal structure of Modernizr has been completely revamped, making it easier to contribute to and easier to customize/extend Modernizr’s licensing has changed: we’ve moved from a BSD license to MIT. (#679)

Detects

  • 99 new detects and counting (see #1230 for the full list)
  • No detect names are hyphenated anymore; e.g. battery-apibatteryapi, flexbox-legacyflexboxlegacy, etc (#719, #782)
  • Modernizr.contentsecuritypolicy has been removed, as the JS API it was testing is deprecated (#1461)
  • Modernizr.touch has been removed in favor of touchevents and pointerevents (#548)
  • Modernizr.pointerevents now detects DOM PointerEvent support, rather than CSS pointer-events (#800)
  • Detect for CSS pointer-events is now called csspointerevents (#800)
  • Fixed false-positives in fontface detect (#1147)
  • Our tests for Flexbox have been revised to better match developers’ expectations:
    • Modernizr.flexbox returns true if flex-basis is supported – which represents a “reasonable” modern spec implementation (Chrome, FF, Safari and IE11 all pass this)
    • Modernizr.flexwrap has been added to detect features missing from Firefox’s implementation
    • Modernizr.flexboxtweener has been added to detect the implementation used by IE10
    • Modernizr.flexboxlegacy remains unchanged
  • WebGL detect is now more reliable, using HTMLCanvasElement.supportsContext() where available (#689)
  • WebGL extension enumerations are now attached to Modernizr.webglextensions rather than Modernizr.webgl
  • The datauri detect now has a over32kb subproperty which will be true if the browser supports data URIs longer than 32 kB (#321)
  • audio detect now also checks support for the Ogg Opus codec, exposed as Modernizr.audio.opus (#699)
  • audiodata detect has been removed, because the implementation was very poor; this spec has been deprecated in favor of the Web Audio API (#1019)
  • video detect now has an hls subproperty representing support for the HLS video format (#1317)
  • todataurljpeg, todataurlpng and todataurlwebp are no longer asynchronous (#802)
  • fullscreen detect has been updated to use document.exitFullScreen rather than the prefixed versions of document.cancelFullScreen as per the latest spec (#739)
  • indexeddb detect now has a deletedatabase subproperty, representing support for the indexedDB.deleteDatabase() method which isn’t implemented in some browsers (#1238)
  • webp detect now has lossy, lossless and alpha subproperties, representing support for various variants of the WebP format; the root webp property still represents basic lossy support (#1229)
  • Fixed a bug in cssvwunit, cssvminunit and cssvmaxunit which could give incorrect results when scrollbars are present (#1045)
  • Fixed a bug in emoji detect where the test could stop working once minified (#899)
  • Fixed a bug in regions detect where wrong result could be given when page is zoomed (#940)
  • Fixed a bug in csstransforms3d detect where wrong result could be given when page is zoomed (#760)
  • Fixed a false-positive for the cssscrollbar detect in IE9 (#698)
  • Fixed a bug where indexeddb would throw an error if indexedDB was disabled via a browser flag (#798)
  • Fixed various false-positives in fileinput detect (#772)
  • Fixed various incorrect results in history detect (#733, #1471)
  • Fixed a false-positive for cookies detect in IE9 (#666)
  • Fixed a false-negative for csstransforms3d in WebKit browsers when certain styles are present on the page (#740)
  • Fixed a bug where a page reload could crash Safari 5.1 (#524)
  • Fixed cssmask detect (a typo meant it was ineffective) (#671)
  • Fixed userselect detect (a typo meant it was ineffective) (#671)
  • Fixed a bug in displaytable detect when page is in RTL (#716)
  • Improved accuracy of xhr2 detect in Firefox 3.6 (#1178)
  • Improved accuracy of customprotocolhandler detect in Android 2.x (#992)
  • Blacklisted Android 1.x & 2.x from passing the csstransforms detect, because it’s excessively buggy (#903)
  • Fixed backgroundblendmode detect (#1420)

APIs

  • Modernizr used to include a Function.prototype.bind polyfill (this was documented, but was somewhat hidden); this has been removed (#1278)
  • testProp(), testAllProps() and prefixed() now use CSS.supports() under the hood for most CSS feature detects where available, improving performance and accuracy (#818)
  • Modernizr.load has been deprecated in favor of using yepnope.js directly; from v3.0, yepnope.js must be included in the page in order for Modernizr.load to work: calling .load() will simply pass the arguments on to yepnope(); this will be removed fully in a future release (#1241)
  • New Modernizr.on() API, for handling asynchronous detects (#622)
  • New prefixedCSS() API, which functions like prefixed() but returns the prefixed property name in kebab-case (hyphenated, as used in CSS) instead of camelCase (#848)
  • testProp(), testAllProps(), prefixed() and prefixedCSS() now accept property names in either camelCase or kebab-case; for prefixed*() the format of the response depends on which function you call: prefixed() always returns camelCase, prefixedCSS() always returns kebab-case) (#848)
  • New noPrefixes build option, which forces feature detects to only return true if the feature is supported without a vendor prefix (#1082)
  • New enableJSClass build option, which determines whether or not to add js/no-js classes to the <html> element when Modernizr runs; true by default (#1385)
  • hasEvent() previously used “appropriate” elements for certain tests: submit would be tested against a <form> element, error would be tested against an <img> element, etc; this is no longer the case – for consistency, all will be tested against a <div>, unless otherwise specified by the optional elem argument (#636)
  • hasEvent()'s optional elem argument can now be an element or simply a tag name, e.g. Modernizr.hasEvent('click', 'a') (#636)
  • If a classPrefix is specified as a build option, it will be applied to no-js/js classes as well (previously this only applied to feature classes) (#1031)
  • Fixed a bug where classPrefix wasn’t applied to the class set for the first-executed feature detect (#1053)
  • testProp() and testAllProps() now accept up to 3 arguments: testProp(prop, [value, [skipValueTest]]); if a value is provided, Modernizr will ensure that value is supported for the named CSS property, delegating to CSS.supports() where available; if skipValueTest is true (default is false), the value test won’t be conducted when CSS.supports() isn’t available
  • addTest() will now set subproperties if given a property name containing a period (.), which can be used for defining custom structured detects, or for extending existing detects (e.g. adding custom codec detects to Modernizr.audio) (#1089) (buggy: #1355)
  • Fixed a bug where calling Modernizr.prefixed() with an obj argument which doesn’t support binding would throw an exception (#1014)
  • Fixed a bug where calling Modernizr.mq() inside a hidden iframe would throw an error in Firefox (#886)

The website

We started out revamping the builder to make it easier to find the detects you needed and evolved into a complete revamp of the website.

Some things to point out:

  • The website uses service workers so after you’ve created your build in theory you can do the same offline
  • You can search for a detect in real time on the download page.
  • Each detect now has a special comment that we parse and display on the download page, with handy information about the detect including polyfills and links.
  • Best of all it’s open source so if you find issues please report or fix them!

Thanks

Of course we can't thank the community enough for their massive contributions to Modernizr 3.0 all 86 of them!

AlbertoElias, BYK, DannyJoris, MoOx, NikV, RReverser, Rowno, SimenB, SlexAxton, TalAter, Wilto, Yomguithereal, alrra, anenviousguest, aroben, atdt, ausi, bportnoy, brendankenny, burnersk, cagerton, calweb, candrews, chrisjlee, danbeam, darcyclarke, dbow, ddprrt, devongovett, devote, dmethvin, doctyper, drublic, edmellum, emilchristensen, fgnass, filaraujo, frederfred, frob, gaearon, garrypolley, genintho, grayghostvisuals, hzoo, jacobrossi, janroures, javiercejudo, jmartin84, jokeyrhyme, jon301, jonathanong, jongrover, jtangelder, kkirsche, komachi, kristerkari, lbesson, mathiasbynens, mikach, mrkiffie, nok, patrickkettner, paulirish, robocoder, robwierzbowski, rose, rrrene, rxaviers, ryanseddon, silverwind, slavanga, ssidorchick, steveyken, stucox, svinkle, swaydeng, teebot, thanpolas, tnajdek, tomgco, triblondon, vlajos, wilddeer, zachleat, zeno, zhorvath

A few worthy call outs, Patrick Kettner who came in and contributed an enormous amount of effort and work to get 3.0 to the state it is, without him we wouldn't of got to this release. Stu Cox who also came onto the scene and contributed a huge amount of work and Joe Critchley who took on updating the look and feel of the our new shiny website.

]]>
https://modernizr.com/news//news/modernizr-3-new-release-sitehttps://modernizr.com/news//news/modernizr-3-new-release-siteFri, 11 Sep 2015 00:00:00 GMT
<![CDATA[Modernizr 3, Stickers & Diversity]]>While Modernizr was meant from day one to eventually become unnecessary, that day is far from here, and so development on the library goes on. Some of the things we’ve been busy with:

Version 3

Modernizr v.3 is not a mere version bump with some new additions; it is a complete architectural rewrite of the entire library and all of the 150+ community feature tests. The team and some of our great contributors have worked tirelessly to convert all of the tests to facilitate a new loading structure based on AMD, and are currently embedding the tests with important meta-data such as known issues, sample usage and more.

There is a new site in the making as well, with a new documentation page taking your feedback into account (feel free to fill out that survey if you haven’t yet), and a new download page that makes it much easier and faster to create the custom build that you need.

You can help make v.3 become a reality by closing issues, or by updating open Pull Requests to the new v.3-compatible format for tests (see this example for what that looks like).

Stickers!

an example of the modernizr logo on a stickerthe top of a macbook pro, with the modernizr sticker in the upper left

While we work on version 3, you can show your support with some fancy new Modernizr stickers, courtesy of the fine folks at DevSwag. Put these stickers on your laptop, fixie bike, and anything else you’d like to “modernize” (ahem).

The stickers are just $6 for a pack of four, and all of the proceeds that go to Modernizr will be donated to the Ada Initiative. All of us here at Modernizr care deeply about having a healthy and diverse community of developers, and the Ada Initiative does great work that we support.

Diversity in tech & open source

The tech community, and in particular open source, is currently quite male-dominated. By itself that’s not so much of a problem, but it becomes more of one when it leads to increasingly male-specific behavior and cultures, which can be hostile and alienating to various groups—other men included.

Currently in tech, typically male behavior such as aggressiveness is rewarded with more visibility and, consequently, more opportunities. Discussions online, whether they’re about community diversity, ruby vs. python, or tabs vs. spaces, often devolve into a lot of verbal aggression, breeding an angry and hostile culture from which no one really benefits. Similarly, a harmless joke here or there isn’t a big deal, but the same kind of jokes over and over again breed a certain culture, and that culture is often exclusionary to people who don’t care for those jokes.

When this happens within a small group of people, it’s one thing. When it happens industry-wide, we’re excluding people from our field altogether, and that is a terrible thing that fundamentally undermines the meaning and value of our work. “Merit” is a total fallacy if you only allow a certain kind of people to be measured for it.

Our industry is vast and encompasses many different types of people. It is time to stop having this belief that tech, web development, or open source, is a community composed entirely of “other people who are just like us,” and that it gives us carte blanche for behaving however we want, or for saying whatever we want. Sexist, misogynist, racist, homophobic and otherwise exclusionary language, jokes and slurs—whether we put them in commits, source code, or comments to blog posts—are absolutely unacceptable.

It’s time for us to stop trying to get the industry or community to behave according to the rules set forth by the most vocal majority. Each and every one of us deserves to be respected and listened to, to not be shouted down by an angry mob.

We should not judge our peers solely by the quality of their code or pixels: that’s dehumanizing and wrong, and encourages individualism. It’s time for us all to embrace the diversity that we represent: different people from different backgrounds with different skills, ideas and opinions.

Since Faruk first started Modernizr in 2009, it has evolved through a collective, social effort. This wouldn't have been possible without the vast range of different contributors, each bringing their own unique slant. It’s ultimately this diversity that has allowed Modernizr to be the broad-reaching tool it has become — and it will only be able to continue to grow and improve if it sticks to and supports these ideals across the entire community.

]]>
https://modernizr.com/news//news/modernizr-v3-stickers-diversityhttps://modernizr.com/news//news/modernizr-v3-stickers-diversityTue, 02 Apr 2013 00:00:00 GMT
<![CDATA[Modernizr Policy on Browser Bugs and Feature Detects]]>Modernizr detects features in browsers based on the APIs they expose to enable that feature. However, sometimes a browser vendor will implement a feature, but its implementation is buggy; for instance, its API exists but the output is not rendered, or the feature doesn’t work right—or even at all. This sometimes results in what we call “False Positives”: a feature that tests positively, but is not reliable or usable. (For example, Opera Mini provides a false positive for CSS Gradients.) Other times we might calls these plain “browser bugs,” issues in the implementation that doesn’t affect the common use but is an edge case issue. (For example, box-sizing doesn't work with min-height in Firefox.)

False positives are a developer’s nightmare: they can be hard to discover, even harder to fix, and are almost always frustrating. So what can we do?

Modernizr aims for accuracy in tests based on their associated ECMAScript, HTML and CSS specifications. Yet sometimes something slips past and it reports a false positive. We are in the process of documenting these cases and putting them in one single page for easy consumption.

Found a false positive?

When you encounter a false positive, add it to the Modernizr Issues tracker. We will give it the “False result” label. Also please clearly describe which browser(s) it is a false positive in, and whether the implementation is buggy, broken or incomplete.

Wherever possible, we will attempt to work around the issue (for example: forcing a reflow, adding the element to the DOM, etc), though as a last result we will add a UA sniff. We'd appreciate your help with a pull request, as well!

Above all: report false positives to their respective vendors’ bug trackers. (Many times it's a mobile port of WebKit that has the problem; while it may not exist in other WebKit ports, you can file these at the WebKit tracker regardless.) That is the best way to get these issues resolved, and helps Modernizr to be a great feature detection library.

Browser bug?

We agree that browser bugs should be detected instead of assumed for given UA strings. This is how jQuery.support works. However, Modernizr detects features and will not be collecting bugs. We do recommend you file the issue with the appropriate vendor and blog about it or post on Stack Overflow to get the word out there with your proposed fix.

Thanks

Modernizr will strive to report accurately, even if the browser is returning a false positive for the correct detect.

]]>
https://modernizr.com/news//news/modernizr-policy-feature-detectshttps://modernizr.com/news//news/modernizr-policy-feature-detectsMon, 07 Jan 2013 00:00:00 GMT
<![CDATA[Modernizr 2.6.2 released]]>Summer is over, back to work! We’ve released Modernizr 2.6.2 with a number of new detects, bug fixes, and test improvements for your modern development needs.

Some notable fixes include:

  • Fix for a hilarious edge case in Safari where if you set your body or html element to overflow-y: scroll and apply styles to the webkit-scrollbars (see demo), the browser spontaneously refreshes
  • HTML5 Shiv got a fix for better compatibility with jPlayer
  • Generated Content false-positive fix for IE7
  • Fix for our download builder and turning off css classes
  • Better Travis CI output for unit tests using grunt
  • All incoming pull requests are tested against our test suite with Travis CI

Detects

We’ve also added some new detects:

  • Content Security Policy
  • CSS's object-fit
  • position: sticky;
  • @supports : CSS's new native feature detection
  • viewport unit tests: vhunit, vmaxunit, vminunit, vwunit
  • input[form] attribute
  • new iframe attributes: sandbox, seamless, srcdoc
  • PointerLock API

Test improvements

And lastly, there have been updates to these tests:

  • background-size: cover
  • css filters
  • css subpixelfont
  • elem-track - reflecting partial support by IE10
  • gamepad api

For more details on the exact code changes of this release, see the full changelog on GitHub.

We thank our great dev community who have contributed much of the work for this update. Thanks to their moms and dads, too.

]]>
https://modernizr.com/news//news/modernizr-262https://modernizr.com/news//news/modernizr-262Tue, 04 Sep 2012 00:00:00 GMT
<![CDATA[Modernizr 2.6 released]]>Modernizr 2.6 is now available. Below is a summary of the major changes. The full diff is also available.

You can download the latest at the builder. You must upgrade if you're using geolocation or flexbox; otherwise you only should upgrade.

Detects

We’ve added a lot of new tests, many of which by the community, and updated existing ones:

  • Geolocation used to be a trivial detect but two issues have come up recently that make it trickier. If you're using your own detect, read the details.
  • The ESR release of Firefox exposes MozWebsocket whereas every other supporting browser uses the standard WebSocket. We've quickened and simplified our detect accordingly.
  • We got a last minute pull request from David Baron, the czar of Gecko, who recommended we don't allow Modernizr.testProp('pointer-events') to pass, and instead require the camelcased equivalent: pointerEvents
  • Opera fixed a bug affecting the <input type=color> detect, so we've sped up and simplified our detect.
  • Our detect for flexbox has been updated as the new spec had naming changes. The detect for the flexbox implementation that you see in older mobile WebKit is now available as flexboxlegacy (without a hyphen).
  • Our WebGL test got much faster, though it is less reliable. We made this decision because many Modernizr users include all tests they don't use and the earlier WebGL test could last for 500ms sometimes. If your site or app relies on the WebGL test, make sure you also have a fallback in case the context creation fails. It can fail due to inadequate GPU or lack of graphics memory, see also recovering from a lost context.
  • Plenty more inline documentation added about detection weirdness. The source comments are a fun read.
  • As well as tightening up support for existing tests, we've also added a number of new detects, many submitted by the community:
    • blob-constructor
    • css-backgroundposition-shorthand
    • css-backgroundposition-xy
    • css-calc
    • css-filters
      • Detecting the new CSS filters, but not catching the legacy IE filter property.
    • css-lastchild
    • css-mask
      • This correctly finds the WebKit mask property without a false positive on Firefox's SVG mask support.
    • css-regions
      • Contributed by Adobe.
    • css-subpixelfont
    • exif-orientation
      • Did you know iOS Safari is the only browser to use the orientation bit in EXIF and rotate the asset accordingly? Well, Modernizr does.
    • forms-fileinput
      • Detecting <input type=file> not working on iOS <6
    • dart
    • network-xhr2
    • style-scoped
    • svg-filters
      • Only detects SVG filters appling to SVG content. SVG filters on HTML is awaiting.
    • vibration
    • You can view all of these detects on GitHub and add them in the download builder today.

Dependencies

  • html5shiv is now up to 3.6, fixing some edgecases users ran into
  • yepnope was updated to 1.5.4

Development Workflow:

  • We're using EditorConfig to keep our whitespace policy consistent
  • GruntJS powers our automatic linting and minification now.
  • We are integrated with Travis, so after all commits, Travis runs our test suite in a headless WebKit via PhantomJS.

Up next, we're going to clarify our touch detect: Is it detecting touch devices or touch events; and which touch event model? We're also going to redesign the download page and update the documentation with some more approachable documentation.

As always, if you'd like to get involved, hop into the GitHub issue tracker.

]]>
https://modernizr.com/news//news/modernizr-260https://modernizr.com/news//news/modernizr-260Thu, 19 Jul 2012 00:00:00 GMT
<![CDATA[Modernizr 2.5: Supercharged for 2012]]>Modernizr 2.0 came out more than eight months ago; we’ve not sat still in the period since, and today we’re proud to announce the release of Modernizr 2.5, our biggest update yet!

New in 2.5

The list of new things in 2.5 is too big for GitHub to handle, but here are the highlights:

  • More than 60 new feature detects for emerging browser features; check out the full list or peruse all of the community-driven tests in our feature-detects folder.
  • We now have a super robust and integrated test suite. Paul did a great video detailing how it works.
  • Brand new embedded and included micro-libraries: html5shiv 3.2 and yepnope .js 1.5.
  • Modernizr.prefixed() can now detect prefixed DOM features and give you a hook. E.g.: Modernizr.prefixed('requestAnimationFrame', window) // rAF function
  • Bugfix for possible false negative when browser support for prefixed CSS Transforms is sunsetted.
  • We now ship with a Function.prototype.bind polyfill included by default. You’re welcome!

    Modernizr 2.5 introduces some minor backwards-compatibility breaks due to changes in features and behavior.

  • We no longer include Respond.js in the builder. If you still require Respond.js in your project, just include it manually.

  • Modernizr._domPrefixes has been renamed to Modernizr._cssomPrefixes, and a new, lower-case Modernizr._domPrefixes has been introduced.
  • We’ve removed KHTML prefix testing, due to lack of usage.

    We encourage all users to upgrade to Modernizr 2.5, as there should be no regressions. If you do happen to encounter issues, please file them on GitHub.

    Thanks

    This great release would not have been possible were it not for the many contributions from people who volunteered bug reports, bug fixes and all new tests. We’ve made a dedicated page to thank everyone who contributed to Modernizr 2.5; this release has been the most collaborative effort yet for Modernizr, and we couldn’t be more excited about that.

We’re similarly excited to announce the expansion of the team. Ryan Seddon has been made an official member at last, and we also welcome Alexander Farkas to the team. And speaking of Ryan, he’s done a great Learnable course on Modernizr, so if you’re relatively new to the library you should check it out!

Elsewhere

While not a Modernizr effort, we do want to bring some attention to a very useful new reasource, ideal for people who use Modernizr: HTML5 Please. Together with Can I Use…, these two sites should cover all your questions over which features are reliable and safe to use based on what audiences you need to support.

We’d also like to note that our HTML5 Cross Browser Polyfills wiki is still growing, with many more polyfills having been added.

Modernizr 2.5 is the best starting library for anyone taking advantage of the latest in HTML5 and related technologies, and we hope you’ll enjoy it.


Update Feb 8: we’ve included another couple of small—but significant—updates, and have released Modernizr 2.5.2.

Notably, this latest update includes html5shiv 3.3, which features an up to 16x performance increase over the shiv that was bundled in Modernizr 2.0. The html5shiv team (Jonathan Neal, John-David Dalton, and Modernizr team member Alexander Farkas) has been hard at work (view changelog) making this foundational piece of the HTML5 infrastructure fast and robust. (To be clear, this is the exact same shiv available in Remy Sharp's googlecode repos.) Plus, using Modernizr 2.5 (with the included html5shiv 3.x), you no longer need innerShiv; the fix is automatic.

Additionally, our download builder now ships with Yepnope 1.5.2.

We also want to highlight a few more changes from 2.5:

  • We’ve toughened up canPlayType checks for Firefox 3.5.0, 3.5.1 and 4.0.0 - 4.0.4
  • In iOS5 Private Browsing mode you can use localStorage.getItem but it throws an exception for setItem. We test it out and set Modernizr.localStorage to false if we cannot store.
  • We now have a <datalist> detect with no false positives! It’s accessible through Modernizr.input.list [#146]
  • If you use the transitionEnd event, we’ve documented the correct IE10 and spec’d behavior.
  • If you, by chance, have a class of oh-no-js-oh-my on the <html> element we wont remove it anymore as part of our no-js to js switch.
  • The Modernizr wiki has been reorganized. Much cleaner!
]]>
https://modernizr.com/news//news/modernizr-25https://modernizr.com/news//news/modernizr-25Mon, 06 Feb 2012 00:00:00 GMT
<![CDATA[How Does Modernizr’s Test Suite Work?]]>Sometimes, members of the team get asked how we ascertain and verify that the features we detect are accurately detected. It’s not always a simple process, but over time we’ve put together a test suite that helps us out a lot.

Paul has recorded a screencast discussing how this test suite for Modernizr was built. The brief summary: initially built with QUnit, the test suite has coverage over the full API surface area of Modernizr, even using kangax’s detect-global script to assure no globals are introduced beyond Modernizr and yepnope. After that it gets interesting—as verifying the results from Modernizr’s detection of the current browser’s features isn’t straightforward. We end up using APIs from both Caniuse.com and GitHub, using projects like Lloyd Hilaiel’s JSONSelect, Lindsey Simon's ua-parser (ported to Node by @tobie), some ES5 polyfills, and some real sexy jQuery Deferred action to elegantly handle a bunch of $.getScript calls.

20 minutes of javascript and feature detection action below.

]]>
https://modernizr.com/news//news/modernizr-test-suitehttps://modernizr.com/news//news/modernizr-test-suiteMon, 07 Nov 2011 00:00:00 GMT
<![CDATA[Modernizr and Content Delivery Networks (CDNs)]]>One of the most common requests around Modernizr is for it to be made available on a Content Delivery Network. Back in the 1.x days this made a fair bit of sense: there was only one version of the library, and so the compressed version would be useful to have on a CDN for performance reasons.

With the advent of Modernizr 2, however we’ve (re)introduced modular builds of the library, which make the value of CDNs less self-evident. We now make you create a customized build of Modernizr—using only the tests you actually need—when you want a production-ready, minified & compressed version of the library. But with over 40 embedded tests, supporting all possible combinations of tests is impossible, aside of being downright undesirable.

This has caused some confusion, so we’d like to explain the right way to use Modernizr under the various different scenarios that occur.

Development, local: General development and/or learning

When you start building a new project, or if you simply want to learn, you should download the latest development version of Modernizr. This is typically a stage where you don’t know yet which feature detection tests you’ll eventually need by the time you go to production, and don’t need to worry about minification. If you’re building your site or app locally, this is the version to use.

Development + CDN: Test cases, one-offs, partial control-situations

If you’re creating a quick test case using something like jsfiddle, or are writing an entry for a contest like 10K Apart, using a CDN can be not just useful, but downright necessary. If your situation relies on externally-hosted code, use one of the CDN releases.

But be warned: these versions contain all 40+ tests! That means they are full-fledged libraries with almost certainly a lot of things you don’t need in a final product.

That’s why the Microsoft CDN and CDNJS releases of Modernizr are essentially just Development versions, but hosted somewhere for you to use.

Custom build: All production uses

Are you priming your website or app for production? Then it’s time to head over to the custom download builder, tick all the tests your project makes use of, and hit that Generate button to make your own special build.

All production uses of Modernizr should be using a latest custom build from the site. This ensures that you won’t run into any (old) bugs, and will have the absolute minimum amount of code and execution time needed for the best possible performance.

As an added bonus, these custom builds now include a directly-usable Build link that allow you to make small tweaks—change a setting here or there—without having to figure out your requirements all over again. It’s also helpful whenever a new stable build is released: just revisit that Build link from your custom build’s source, hit Generate again and you have a new, updated stable build. Always be sure to test!

We hope this simple guide helps you figure out when to use what version of Modernizr.

]]>
https://modernizr.com/news//news/modernizr-and-cdnshttps://modernizr.com/news//news/modernizr-and-cdnsThu, 01 Sep 2011 00:00:00 GMT
<![CDATA[Modernizr 2]]>The long wait is over—Modernizr 2 is here! Modernizr 2 takes feature detection to the next level, enabling a powerful new approach to building great websites and applications that elegantly respond and adapt to the user’s environment.

What’s new:

  • Media Query testing:
    Modernizr.mq('only all and (max-width: 600px)') // true
  • Conditional resource loading via Modernizr.load() — powered by yepnope.js;
  • Vendor prefix detection
    Modernizr.prefixed('transform') // 'WebkitTransform'
  • A whole new set of extensibility methods, so its easy to augment the Modernizr tests with your own.
  • A brand new site!
  • …with the custom build tool baked right in;
  • …and a completely revamped, much more detailed Documentation page.

    Modernizr 2 now contains 40 feature detection tests, but only the development version will come bundled with all of them. When you are ready to get a compressed and minified production build, simply go to the Download page and pick and choose only the tests and features that you need. This way, we ensure that your production build will have the absolute smallest footprint and fastest execution time possible.

    A little tip: when you make a custom build, your URL will be adjusted to reflect your choices exactly. Bookmark it after building in case you ever need to go back and adjust your settings!

    We know you might need to detect more than what’s available in the Modernizr core. Keep an eye on our feature-detects folder for the best-of-breed detections for everything.

Want to learn how to do conditional resource loading with Modernizr.load()? Our new documentation comes with a great Modernizr.load tutorial that takes you through the basics and gets you started. Alternatively, you could check out our site’s own modernizr.com-custom.js for some inspiration.

We’d love to get your feedback on the new Modernizr, the new site and our new documentation and resources pages. Let us know via Twitter, especially if you come across a bug somewhere—things are still a little rough around the edges here and there, but we figured you’d prefer to have Modernizr 2 sooner rather than later.

A huge thanks goes out to all of our contributors who provided code for additional tests, helped us with debugging and getting our detection algorithms right, and so much more. Additionally, special thanks go out to Simon a.k.a. Simurai, for crafting some fancy CSS3 buttons for us, Ryan Seddon for integration work, and Aaron Gustafson for making sure our ARIA roles were top notch.

— Team Modernizr (Faruk Ateş, Paul Irish and Alex Sexton)

]]>
https://modernizr.com/news//news/modernizr-2https://modernizr.com/news//news/modernizr-2Wed, 01 Jun 2011 00:00:00 GMT
<![CDATA[Modernizr 1.7 changelog]]>We put 1.7 live some time ago but never got around to publishing a changelog. Since people have been asking, below are the core changes. For an exact changelog, see the commit log on GitHub between 1.6 and 1.7.

At the heart of 1.7 are the following major changes:

  • A weaker, less crash-prone test for WebGL
  • A fix for @font-face in certain browsers
  • Faster Drag & Drop test
  • Updated IE Print Protector for better speed and reliability
  • One less content reflow due to better className setting

Beyond these main changes, 1.7 fixes lots of small bugs like tiny memory leaks and the occasional false returns in certain browsers. 

A small update on the Modernizr 2 front: we’re getting very close to releasing it, so if you encounter any major bugs using either 1.7 or the 2.0 beta builder, please report them on GitHub as soon as possible. We already have a lot of issues and features pushed to our planned 2.1 release, but would love to make sure that the 2.0 release is the absolute best version of Modernizr yet.

]]>
https://modernizr.com/news//news/odernizr-17-changeloghttps://modernizr.com/news//news/odernizr-17-changelogThu, 12 May 2011 00:00:00 GMT
<![CDATA[Modernizr 2 Beta]]>A brand new year, a brand new Modernizr! What’s new in 2011:

  • A new addition to our team, Alex Sexton
  • We’re introducing a new builder, so you can customize your download of Modernizr to suit your needs
  • A first beta release of Modernizr 2!

    But first, let’s quickly recap what happened in 2010, which was a fantastic year for Modernizr. We had the major 1.5 release really hitting it big, the incremental 1.6 and small site update, and finishing off the year by winning the Open Source Application of the Year category at the 2010 .net Awards. We’d like to thank all of our contributors for their hard work making this such a great open source application. But looking forward to 2011, we have so much more in store for you that 2010 will appear mundane by comparison.

    We’re kicking it off with some pretty exciting news right away. First, we’ve expanded our team to include Alex Sexton. Due to this addition we’ve also formalized our individual roles in the Modernizr Team, as such:

  • Faruk Ateş: Project Lead

  • Paul Irish: Lead Developer
  • Alex Sexton: Developer

    Second, Alex has been working on something we’ve all wanted since the day Modernizr was released, and that’s the ability to customize your own download of the library to only include the tests that you want. This functionality was kept out for simplicity’s sake originally, but has become sorely needed since then. Thanks to Alex, Modernizr 2 will have this functionality—and even better than originally imagined, too. The original plan involved a server-side compiler, but Alex’s fine work, unofficially named Modulizr, has brought us an all-client side builder.

    Best of all: you can start playing around with it right now because today we’re launching the first beta of Modernizr 2!

    This very first beta introduces the customizability of Modernizr 2, allowing you to pick and choose the tests you want in your production-optimized download. We’d love to get your feedback through use of the (beta) builder, so please head on over the beta page and configure your preferred download of Modernizr.

    Looking beyond the beta, our road map for Modernizr already includes specifics for a 2.1 release. We’re committed to getting Modernizr 2 finished and out in the open as soon as possible, and will have more announcements for you in the near future. For now, enjoy the beta and have a fantastic 2011!

    — Team Modernizr

]]>
https://modernizr.com/news//news/modernizr-2-0-betahttps://modernizr.com/news//news/modernizr-2-0-betaMon, 17 Jan 2011 00:00:00 GMT
<![CDATA[Modernizr 1.6 & The Road To 2.0]]>Today we’re announcing the new Modernizr 1.6, an interim release in the run-up to the upcoming Modernizr 2.0—a release slated for later this year which will take the library to the next level.

Before we get into what’s new in 1.6, we want to quickly thank Darcy Clarke for his quick but handy CSS tweaks to our site, cleaning things up a little and improving legibility. Much like today’s 1.6 release, these changes to the site reflect some of what’s coming up in the new 2.0 release and the “2.0” website, if you will.

As said, Modernizr 1.6 is an interim release and closes some important issues while adding a few new detections. Besides bringing it down to a mere 3.8Kb minified and gzipped, the biggest improvement is a completely revised @font-face test, which fixes the FOUT—Flash Of Unstyled Text—which was a somewhat common issue when combining Modernizr with Typekit.

We’ve also added support for WebGL, Touch events, Flexible Box Layouts and Inline SVG. Additionally, several existing tests have been improved to better support newer browser releases, as well as fix some minor bugs.

There are some important changes in 1.6: first, the Modernizr.websqldatabase test has been simplified. It no longer creates a database, which solves an annoying Safari pop-up issue and stops Modernizr from littering the web with databases, but it comes at somewhat of a cost: Chrome in Incognito mode will now false-positive on this test. The extended test remains commented-out in the non-minified source, for those who need it to be exact.

Second, we’ve deprecated two properties: Modernizr.crosswindowmessaging and Modernizr.historymanagement. Going forward, these two properties are simply:

  • Modernizr.postmessage
  • Modernizr.history

    Simpler, cleaner, and they now match the actual DOM property they’re testing for. Keep in mind that, as with other tests, the Modernizr property is all-lowercase but the actual DOM property is window.postMessage.

    Lastly, we’ve put the oft-requested CSS text-shadow test in this release. It still false-positives in Firefox 3.0, but we think web designers are okay with that these days.

    We hope you enjoy this new release, and stay tuned for big changes with the upcoming Modernizr 2.0!

Download the new Modernizr 1.6 from the front page

]]>
https://modernizr.com/news//news/modernizr-1-6https://modernizr.com/news//news/modernizr-1-6Faruk Ateş]]>Mon, 25 Oct 2010 00:00:00 GMT
<![CDATA[Modernizr 1.5: new features, unit tests added]]>We're proud and pleased to announce the immediate release of Modernizr 1.5!

Rather than an incremental upgrade, we've opted to shift into a higher gear and add the full shebang of what we've been working on. Here's a list of new things we detect:

  • SVG! Including SVG Clipping Paths and SMIL
  • Web SQL Database
  • IndexedDB
  • Web Sockets
  • hashchange event
  • History and Session Management
  • HTML5 Drag and Drop
  • Cross-document Messaging

    Additionally, IE can now print HTML5 elements (courtesy of @jon_neal's print protector), IE9 should be fully supported (let us know if you discover inconsistencies), and we also support more browsers: older Safari versions, Nokia and Blackberry mobile browsers, and Konqueror via the -khtml- prefix. Detection of Opera's CSS3 support for transitions and transforms was fixed, as well.

    A few big things have kept us busy preparing a good release. Flash detection (Flash Blockers included) became a hot topic and we really wanted to include it, but at the time no reliable or complete mechanism was available. We wanted to include (and still recommend) Mark Pilgrim's excellent Flash Block Detector but decided that it was too large a codebase to include in the default release of Modernizr—especially given the modular Modernizr 2 plans on the horizon—and so Flash detection is out for now.

    Then came the discovery that Google Chrome implemented Touch events even on the desktop (why, Google, why?) paired with the regrettable fact that Palm's WebOS browser doesn't support common Touch events at all. For a browser that only exists on touch-based devices, this was too critical an issue for us to ignore. So Touch testing went out again, too.

We have many more features we'd like to include; please visit the GitHub issue tracker to review all the additional tests.

For developers, contributors and people looking to learn from Modernizr we now have a set of unit tests available on the GitHub repository, courtesy of Paul. These help prevent errors and inconsistencies from finding their way into the source code, making Modernizr more robust and reliable. The unit tests also include a second part, which pulls the data tables in from Find Me By IP and creates a feature parity overview for all the browsers.

Along with the 1.5 release comes a license upgrade: Modernizr is now dual-licensed under BSD and MIT.

Thanks for all the input and code to miketaylr, fearphage, kangax, richbradshaw, @itpastorn, @jon_neal, dshaw, itrelease, mathiasbynens, airportyh, jeffsmith, rjcoelho, lucideer, peol and mislav. The high quality of this release wouldn't be possible with input from experts like these.

We hope you enjoy the hard work we've all put into it, but we'd love to hear your feedback on Modernizr 1.5's new changes, so let us know via Twitter what you think!

]]>
https://modernizr.com/news//news/modernizr-15https://modernizr.com/news//news/modernizr-15Faruk Ateş and Paul Irish]]>Mon, 14 Jun 2010 00:00:00 GMT
<![CDATA[Updates on the Modernizr front]]>As you've undoubtedly noticed, it's been relatively quiet on the Modernizr front from our side, with no news or new releases since the start of the year. Nonetheless, everyone else has started getting more and more busy using Modernizr to enhance their sites without sacrificing control over older browsers. Progressive Enhancement is becoming increasingly commonplace and we couldn't be more excited about that.

So where do things stand? Well, we've been working, over on GitHub, at getting the next release of Modernizr ready, version 1.2. We're not quite there yet, but we are setting a planned release date of Thursday, April 22. Every time we're almost there another new feature or issue pops up that we have a hard time excluding from the next release, but it's more important to iterate regularly than do big pushes for a tool like this.

Related to all this has been an increasing effort towards realigning Modernizr; the site isn't what it could and should be, the community around Modernizr isn't as cohesive yet which leads to fragmented and overlapping efforts in promoting the tool, and the explanation of what Modernizr is and how it works is still lacking. Clearly, lots of room for improvement—and we're not just aware of it, we're working to fix it.

One of the biggest issues of the current site is the static-ness of it. For instance, we really want to promote sites that use Modernizr, but there's no easy way to submit your site to us. This and many other things will be addressed in the redesign.

The absolute biggest announcement is saved for last, and that is: Modernizr 2.

Early on, before Modernizr was released yet, my friend Mike Krieger and I were brainstorming on how to offer Modernizr. Initially, my plan had been to offer some configuration tool wherewith you could specify which features you wanted to test for, and download a customized build of Modernizr that suited your needs. Mikey and I got all excited by the possibilities of tracking this data, observing which features web designers & developers were most interested in, and so forth.

Then we realized that this brought about a ton of complexity, far too much for the introduction of the library. So, we dropped that idea and instead focused on making a simple, easy to use toolkit without any complexity in how to get it: just download it, include it and you're set.

Well, turns out that the idea itself wasn't a bad one, it was just too ahead of its time. As the Modernizr library grew its feature-set, it also grew its footprint and execution time. Thanks to the talents of Paul and the many contributors committing code over on GitHub, it has stayed incredibly lean and fast—but also at the cost of things we'd really like to add, like SVG.

SVG is an oft-requested feature for Modernizr to test against, and we really want to add it. But, to do it right would involve doing not just a basic one-line test against something like "window.SVG"—no, you have to do a very large number of tests so you can accurately report what parts of SVG the browser supports. To add that to Modernizr right now would bloat the library and slow it down, even though most users won't make use of it.

With Modernizr 2 we'll be breaking things up a little and allow you to customize your download if you so choose to. There will still be one simple, default download containing the core features of the library, but for advanced users there will be a configuration tool so you can pick and choose and add (or subtract) all the features you want.

So those are some of the updates on Modernizr. Next week Thursday we hope to release version 1.2 so if all goes well, you'll hear from us again soon.

]]>
https://modernizr.com/news//news/updates-on-modernizr-fronthttps://modernizr.com/news//news/updates-on-modernizr-frontFaruk Ateş]]>Wed, 14 Apr 2010 00:00:00 GMT