refactor(docs-infra): simplify custom-element polyfill setup (#25806)
PR Close #25806
This commit is contained in:

committed by
Misko Hevery

parent
c1ae3c16e8
commit
59aab14394
@ -83,28 +83,6 @@
|
||||
|
||||
<script nomodule src="generated/ie-polyfills.min.js"></script>
|
||||
|
||||
<script>
|
||||
//load CE polyfill
|
||||
//HACK: webpack's html plugin mangles the document.write calls if we don't trick it.
|
||||
|
||||
//load the ES5 shim for browsers with native CE support
|
||||
function loadCustomElementsShim(){
|
||||
document.write('<scri' + 'pt src="assets/js/native-shim.js"><' + '/script>');
|
||||
}
|
||||
|
||||
//load the full custom elements polyfill for browsers without support
|
||||
function loadCustomElementsPolyfill(){
|
||||
document.write('<scri' + 'pt src="assets/js/custom-elements.min.js"><' + '/script>');
|
||||
}
|
||||
//detect if we have native CE support
|
||||
if(!window.customElements){
|
||||
loadCustomElementsPolyfill();
|
||||
}
|
||||
else {
|
||||
loadCustomElementsShim();
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
Reference in New Issue
Block a user