chore: format
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
// `script[nomodule]` polyfill for Safari 10.1.
|
||||
// Source: https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc
|
||||
(function() {
|
||||
var check = document.createElement('script');
|
||||
if (!('noModule' in check) && 'onbeforeload' in check) {
|
||||
var support = false;
|
||||
document.addEventListener('beforeload', function (e) {
|
||||
if (e.target === check) {
|
||||
support = true;
|
||||
} else if (!e.target.hasAttribute('nomodule') || !support) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
}, true);
|
||||
(function () {
|
||||
var check = document.createElement("script");
|
||||
if (!("noModule" in check) && "onbeforeload" in check) {
|
||||
var support = false;
|
||||
document.addEventListener(
|
||||
"beforeload",
|
||||
function (e) {
|
||||
if (e.target === check) {
|
||||
support = true;
|
||||
} else if (!e.target.hasAttribute("nomodule") || !support) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
check.type = 'module';
|
||||
check.src = '.';
|
||||
document.head.appendChild(check);
|
||||
check.remove();
|
||||
}
|
||||
}())
|
||||
check.type = "module";
|
||||
check.src = ".";
|
||||
document.head.appendChild(check);
|
||||
check.remove();
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user