From ed37953db0a5f3eefd832e083d2f156a52ae6733 Mon Sep 17 00:00:00 2001 From: ekoooo <954408050@qq.com> Date: Thu, 8 Jun 2023 14:55:35 +0800 Subject: [PATCH] fix: skip loadIframeImage when img tag src attribute is empty When img tag src attribute is empty, if current page URL contains hash symbol, the value of `image.src` and `window.location.href` are not equal. --- src/js/print.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/print.js b/src/js/print.js index 40f9629..f982e12 100644 --- a/src/js/print.js +++ b/src/js/print.js @@ -84,7 +84,7 @@ function performPrint (iframeElement, params) { function loadIframeImages (images) { const promises = images.map(image => { - if (image.src && image.src !== window.location.href) { + if (image.getAttribute('src')) { return loadIframeImage(image) } })