It's a polyfill for <link rel="preload">
, great feature implemented only in WebKit so far
(see lastest data here). 100% compatibility with specification and existing
implementations is not guaranteed.
Just read great article here.
Check out live demo.
<head>
<link
rel="preload"
as="style"
href="/link/to/stylesheet.css"
onload="this.onload=function(){};this.rel='stylesheet';"
>
</head>
<body>
<script src="/link/to/polyfill.js"></script>
</body>
Important note: value of onload
attribute is very important. Resetting it to no-op function is crucial for working the
polyfill cross-browser (it's required by Internet Explorer which tends to falling into endless loop otherwise).