Skip to content

Instantly share code, notes, and snippets.

@martinbalfanz
Created August 16, 2011 12:56
Show Gist options
  • Save martinbalfanz/1149007 to your computer and use it in GitHub Desktop.
Save martinbalfanz/1149007 to your computer and use it in GitHub Desktop.
Modernizr tests to trigger webkit and opera
/* tests for webkit and opera to fix styling bugs :@ */
Modernizr.addTest('opera', function () {
return /Opera/.test(({}).toString.call(window.opera));
});
Modernizr.addTest('webkit', function () {
return Modernizr.testProp('-webkit-box-shadow');
});
/* css to trigger webkit
*
* @media screen and (-webkit-min-device-pixel-ratio:0) {
*
* }
*
*/
@paulirish
Copy link

a touch more precise:

return /Opera/.test(({}).toString.call(window.opera));

@martinbalfanz
Copy link
Author

pretty cool, ty :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment