Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var sp = [].slice.apply(document.querySelectorAll('link[rel=preload][as=style]'))
sp.forEach(function(item) {
item.onload = function() {
item.rel = 'stylesheet'
item.onload = null
}
})
/**
* For browsers that do not support rel=preload
*/
function rs() {
sp.forEach(function(item) {
item.rel = 'stylesheet'
})
window.removeEventListener('load', rs)
}
window.addEventListener('load', rs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.