File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -224,7 +224,9 @@ function extractTimeoutRules (rules) {
224
224
* @param {string } rules[].type
225
225
*/
226
226
function injectStyleTag ( rules ) {
227
- const styleTag = document . createElement ( 'style' )
227
+ const styleTag = document . createElement ( 'link' )
228
+ styleTag . setAttribute ( 'rel' , 'stylesheet' )
229
+ styleTag . setAttribute ( 'type' , 'text/css' )
228
230
let styleTagContents = ''
229
231
230
232
rules . forEach ( ( rule , i ) => {
@@ -236,7 +238,7 @@ function injectStyleTag (rules) {
236
238
} )
237
239
238
240
styleTagContents = styleTagContents . concat ( '{display:none!important;min-height:0!important;height:0!important;}' )
239
- styleTag . innerText = styleTagContents
241
+ styleTag . href = 'data:text/css,' + encodeURIComponent ( styleTagContents )
240
242
241
243
document . head . appendChild ( styleTag )
242
244
}
You can’t perform that action at this time.
0 commit comments