|
|
@@ -384,7 +384,7 @@ const SingleFileCore = (() => {
|
|
|
const match = DomUtil.matchImport(cssImport);
|
|
|
if (match) {
|
|
|
const resourceURL = DomUtil.normalizeURL(match.resourceURL);
|
|
|
- if (resourceURL != baseURI) {
|
|
|
+ if (resourceURL != baseURI && resourceURL != ABOUT_BLANK_URI) {
|
|
|
let importedStylesheetContent = await Download.getContent(new URL(match.resourceURL, baseURI).href);
|
|
|
importedStylesheetContent = DomUtil.wrapMediaQuery(importedStylesheetContent, match.media);
|
|
|
if (stylesheetContent.indexOf(cssImport) != -1) {
|
|
|
@@ -415,7 +415,7 @@ const SingleFileCore = (() => {
|
|
|
|
|
|
static async resolveLinkStylesheetURLs(resourceURL, baseURI, media) {
|
|
|
resourceURL = DomUtil.normalizeURL(resourceURL);
|
|
|
- if (resourceURL && resourceURL != baseURI) {
|
|
|
+ if (resourceURL && resourceURL != baseURI && resourceURL != ABOUT_BLANK_URI) {
|
|
|
let stylesheetContent = await Download.getContent(resourceURL);
|
|
|
stylesheetContent = await DomProcessorHelper.resolveImportURLs(stylesheetContent, resourceURL);
|
|
|
stylesheetContent = DomUtil.wrapMediaQuery(stylesheetContent, media);
|
|
|
@@ -478,6 +478,7 @@ const SingleFileCore = (() => {
|
|
|
// -------
|
|
|
const DATA_URI_PREFIX = "data:";
|
|
|
const BLOB_URI_PREFIX = "blob:";
|
|
|
+ const ABOUT_BLANK_URI = "about:blank";
|
|
|
const REGEXP_URL_FN = /(url\s*\(\s*'([^']*)'\s*\))|(url\s*\(\s*"([^"]*)"\s*\))|(url\s*\(\s*([^)]*)\s*\))/gi;
|
|
|
const REGEXP_URL_SIMPLE_QUOTES_FN = /^url\s*\(\s*'([^']*)'\s*\)$/i;
|
|
|
const REGEXP_URL_DOUBLE_QUOTES_FN = /^url\s*\(\s*"([^"]*)"\s*\)$/i;
|
|
|
@@ -511,7 +512,7 @@ const SingleFileCore = (() => {
|
|
|
}
|
|
|
|
|
|
static testValidPath(resourceURL) {
|
|
|
- return !resourceURL.startsWith(DATA_URI_PREFIX) && !resourceURL.startsWith(BLOB_URI_PREFIX);
|
|
|
+ return !resourceURL.startsWith(DATA_URI_PREFIX) && !resourceURL.startsWith(BLOB_URI_PREFIX) && resourceURL != ABOUT_BLANK_URI;
|
|
|
}
|
|
|
|
|
|
static matchImport(stylesheetContent) {
|