Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ class MiniCssExtractPlugin {
: '',
'var head = document.getElementsByTagName("head")[0];',
'head.appendChild(linkTag);',
"// old webkit's would claim to have onload, but didn't really support it",
'// https://github.com/kriszyp/xstyle/blob/master/core/load-css.js',
'var webkitVersion = navigator.userAgent.match(/AppleWebKit\\/(\\d+\\.?\\d*)/);',
'webkitVersion = webkitVersion && +webkitVersion[1];',
'if (webkitVersion < 536) {',
Template.indent([
'// http://www.backalleycoder.com/2011/03/20/link-tag-css-stylesheet-load-event/',
'var img = document.createElement("img");',
'img.onerror = resolve;',
`img.src = fullhref;`,
]),
'}',
]),
'}).then(function() {',
Template.indent(['installedCssChunks[chunkId] = 0;']),
Expand Down