Trying to integrate the HTML5 Boilerplate with Polymer Web Components and not entirely clear if webcomponents.js does what modernizr does when it injects all the polyfills for the missing functionality in older, less-functional browsers.
Thanks!
Modernizr just detects features, and gives you a true or false result. Polymer would be something you would load as a result of one of the modernizr tests. They work in tandem, not in place of one another
Related
I'm using Modernizr to make my HTML5 site backwards compatible. It's great, but is there a tool to run automated, headless tests which will parse my HTML for HTML5 features, then test each my code and its features in numerous browsers, and generate a report that I can use to add any polyfills I may have left off or know that I've successfully covered all of my bases using Modernizr?
unfortunately, no. Such a tool has not been made publicly available by anyone.
Even if there was, it would be extremely difficult to do properly. Some things have polyfills that shouldn't be used (see rounded corners and OldIE), or the polyfills that do exist may not be needed in some/most cases.
This is something that is best left to the developer to properly check and test during development.
My basic workflow whenever I am using a feature that I am unsure of, is
check caniuse.com, comparing the data to my own analytics to determine if I even need to detect it. if no - stop. If yes...
Add the Modernizr test for that feature. If a polyfill is needed, then...
Add yepnope test, loading one of the polyfills listed in the metadata filed of Modernizr v3 detect.
rinse, wash, repeat
I am developing a portlet for Liferay (v6.0.5, runs on JBoss). I would like to use HTML5 (canvas to be more specific) in this portlet. How can I find, if the theme I am currently using on the portal does support HTML5?
I know that themes with HTML5 support exist and I have to choose the right one? Or am I wrong and all themes automatically support HTML5?
Thanks for tips!
All the Liferay themes automatically support html5, its the browsers you should be worried about.
There is nothing special to make a theme HTML5 since its just a matter of doctype change (<!DOCTYPE html>) to make the browser know that you are rendering HTML5 stuff. So you can check the doctype in portal-normal.vm and other template files to see if the theme is HTML5.
But for scripting support I doubt if alloy-ui (Liferay's default library) provides any additional HTML5 specific modules for manipulating canvas, file-api etc.
Has anyone managed to rid of hashbang urls for angular.js applications running in non-html5 browsers ?
I have an application targeting IE8/9, and I would prefer not to have hashbang urls. So, looking to use html5 polyfills(history.js etc) with angular. Is it recommended approach ?
Theoretically, could you detect if a browser supports HTML5 and prompt the visitor to upgrade to IE9/Firefox/Chrome/Safari/Opera if it doesn't support some features like CSS3 or audio/video tags?
I'm developing a hobby music site in a mostly walled-garden and would like to prevent people with anitquated browsers from accessing/logging into the site.
Mass appeal is not a requirement as the site is for a niche and maximizes JavaScript and HTML5 use.
I'd suggest using the modernizr javascript api to detect the HTML5 features you desire.
http://www.modernizr.com/
You can use a conditional comment to show a warning to IE non-browsers:
<!--[if lt IE 9]> Get out of here! <![endif]-->
(You can also include a <script> tag that redirects to an upgrade page)
Well, theoretically, yes you could. However, it would really be a pain and not at all foolproof as it would likely rely upon javascript for implementation which could easily be circumvented.
Also, in practice, just about any user agent parameter can be spoofed, so you really couldn't rely upon user agent parameter detection to determine whether or not a user agent actually supports a specific tag.
Modernizr may be a good starting point for you, in the case of detecting HTML5 video.
http://diveintohtml5.ep.io/everything.html
I am keen to try out one of the HTML5 js plugins to use HTML5 markup on a new client project. Has anybody had experience using Remy Sharp's HTML5 enabler (http://remysharp.com/2009/01/07/html5-enabling-script/) or the Modernizr plugin (http://www.modernizr.com/) on a project that can offer tips or gotchas? I am supporting IE7+ as well as the modern browsers.
Thanks
Remy's script is pretty solid. And the latest version has Jon Neal's print enabler plugin as well so you should be good.