single-file-core 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,6 +70,7 @@ async function extract(content, { password, prompt = () => { }, shadowRootScript
|
|
|
70
70
|
const REGEXP_MATCH_ROOT_INDEX = /^([0-9_]+\/)?index\.html$/;
|
|
71
71
|
const REGEXP_MATCH_INDEX = /index\.html$/;
|
|
72
72
|
const REGEXP_MATCH_FRAMES = /frames\//;
|
|
73
|
+
const REGEXP_MATCH_TOP_LEVEL_FRAME = /^frames\/\d+\/index.html/;
|
|
73
74
|
const REGEXP_MATCH_MANIFEST = /manifest\.json$/;
|
|
74
75
|
const CHARSET_UTF8 = ";charset=utf-8";
|
|
75
76
|
const REGEXP_ESCAPE = /([{}()^$&.*?/+|[\\\\]|\]|-)/g;
|
|
@@ -204,7 +205,7 @@ async function extract(content, { password, prompt = () => { }, shadowRootScript
|
|
|
204
205
|
return { docContent, origDocContent, resources, url };
|
|
205
206
|
|
|
206
207
|
async function getContent(resource) {
|
|
207
|
-
return resource.filename.match(REGEXP_MATCH_FRAMES) || noBlobURL ? await getDataURI(resource.textContent, resource.mimeType) : URL.createObjectURL(new Blob([resource.textContent], { type: resource.mimeType }));
|
|
208
|
+
return resource.filename.match(REGEXP_MATCH_FRAMES) && !resource.filename.match(REGEXP_MATCH_TOP_LEVEL_FRAME) || noBlobURL ? await getDataURI(resource.textContent, resource.mimeType) : URL.createObjectURL(new Blob([resource.textContent], { type: resource.mimeType }));
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
async function getDataURI(textContent, mimeType) {
|