修改bug
This commit is contained in:
34
node_modules/style-loader/dist/runtime/insertBySelector.js
generated
vendored
Normal file
34
node_modules/style-loader/dist/runtime/insertBySelector.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
var memo = {};
|
||||
|
||||
/* istanbul ignore next */
|
||||
function getTarget(target) {
|
||||
if (typeof memo[target] === "undefined") {
|
||||
var styleTarget = document.querySelector(target);
|
||||
|
||||
// Special case to return head of iframe instead of iframe itself
|
||||
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
||||
try {
|
||||
// This will throw an exception if access to iframe is blocked
|
||||
// due to cross-origin restrictions
|
||||
styleTarget = styleTarget.contentDocument.head;
|
||||
} catch (e) {
|
||||
// istanbul ignore next
|
||||
styleTarget = null;
|
||||
}
|
||||
}
|
||||
memo[target] = styleTarget;
|
||||
}
|
||||
return memo[target];
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function insertBySelector(insert, style) {
|
||||
var target = getTarget(insert);
|
||||
if (!target) {
|
||||
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
||||
}
|
||||
target.appendChild(style);
|
||||
}
|
||||
module.exports = insertBySelector;
|
||||
Reference in New Issue
Block a user