Last active
July 14, 2016 19:03
-
-
Save jshcrowthe/cbe5d44a93cfceaf6650 to your computer and use it in GitHub Desktop.
Conditionally Load WC Polyfill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webComponentsSupported = ('registerElement' in document | |
&& 'import' in document.createElement('link') | |
&& 'content' in document.createElement('template')); | |
if (!webComponentsSupported) { | |
var wcPoly = document.createElement('script'); | |
wcPoly.src = '/bower_components/webcomponentsjs/webcomponents-lite.js'; | |
wcPoly.async = true; | |
(document.head || document.getElementsByTagName("head")[0]).appendChild(wcPoly); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment