|
|
@@ -693,6 +693,18 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
Object.keys(imageSelectors.srcset).forEach(selector => resourcePromises.push(DomProcessorHelper.processSrcset(this.doc, this.doc.querySelectorAll(selector), imageSelectors.srcset[selector], PREFIX_DATA_URI_IMAGE, this.baseURI, this.batchRequest)));
|
|
|
}
|
|
|
await resourcePromises;
|
|
|
+ if (this.options.removeAlternativeImages) {
|
|
|
+ const shortcutIcons = Array.from(this.doc.querySelectorAll("link[href][rel=\"icon\"], link[href][rel=\"shortcut icon\"]"));
|
|
|
+ shortcutIcons.sort((linkElement1, linkElement2) => (parseInt(linkElement2.sizes, 10) || 16) - (parseInt(linkElement1.sizes, 10) || 16));
|
|
|
+ const shortcutIcon = shortcutIcons.find(linkElement => linkElement.href && linkElement.href != EMPTY_DATA_URI);
|
|
|
+ if (shortcutIcon) {
|
|
|
+ this.doc.querySelectorAll("link[href][rel*=\"icon\"]").forEach(linkElement => {
|
|
|
+ if (linkElement != shortcutIcon) {
|
|
|
+ linkElement.remove();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async resolveStylesheetURLs() {
|