|
|
@@ -161,7 +161,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
this.options.updatedResources = this.options.updatedResources || {};
|
|
|
this.batchRequest = new BatchRequest();
|
|
|
this.processor = new Processor(options, this.batchRequest);
|
|
|
- if (this.options.doc) {
|
|
|
+ if (root && this.options.doc) {
|
|
|
const docData = util.preProcessDoc(this.options.doc, this.options.win, this.options);
|
|
|
this.options.canvases = docData.canvases;
|
|
|
this.options.fonts = docData.fonts;
|
|
|
@@ -177,7 +177,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
if (this.options.saveRawPage) {
|
|
|
this.options.removeFrames = true;
|
|
|
}
|
|
|
- this.options.content = this.options.content || (this.options.doc ? util.serialize(this.options.doc) : null);
|
|
|
+ this.options.content = this.options.content || (root && this.options.doc ? util.serialize(this.options.doc) : null);
|
|
|
this.onprogress = options.onprogress || (() => { });
|
|
|
}
|
|
|
|
|
|
@@ -191,7 +191,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
|
|
|
await this.executeStage(RESOLVE_URLS_STAGE);
|
|
|
this.pendingPromises = this.executeStage(REPLACE_DATA_STAGE);
|
|
|
- if (this.options.doc) {
|
|
|
+ if (this.root && this.options.doc) {
|
|
|
util.postProcessDoc(this.options.doc, this.markedElements);
|
|
|
}
|
|
|
this.options.doc = null;
|