maoserr / epublifier

Converts some webnovels to epub format
https://chromewebstore.google.com/detail/epublifier/eopjnahefjhnhfanplcjpbbdkpbagikk
GNU General Public License v3.0
745 stars 17 forks source link

[BUG] Unable to embed image from some sites like sspai.com #401

Open xjmwx4 opened 3 weeks ago

xjmwx4 commented 3 weeks ago

Unable to embed image from some sites like sspai.com.

maoserr commented 3 weeks ago

hmm, interesting bug, looks like src is getting truncated for some reason

maoserr commented 3 weeks ago

This bug is not related to my code, it appears to be a bug with the Chrome built in dom parser. The source string contains the correct src field, but the parsed dom contains the wrong src field afterwards. I won't be able to fix something like this.

let parser = new DOMParser();
let dom = parser.parseFromString(source, "text/html");
xjmwx4 commented 3 weeks ago

This bug is not related to my code, it appears to be a bug with the Chrome built in dom parser. The source string contains the correct src field, but the parsed dom contains the wrong src field afterwards. I won't be able to fix something like this.这个错误与我的代码无关,它似乎是 Chrome 浏览器内置 dom 解析器的一个错误。源字符串包含正确的 src 字段,但解析后的 dom 却包含错误的 src 字段。我无法修复这样的问题。

let parser = new DOMParser();
let dom = parser.parseFromString(source, "text/html");

this project can effectively embed image from the sites I mentioned.

Demo web: https://webpagetoepub.github.io/

maoserr commented 3 weeks ago

hmm, that is true, I'll check it out. The link you provided does not contain the original source code however, it's been minified.

maoserr commented 3 weeks ago

images are webp images. Epubs don't support webp as far as I know. I'll leave this open in case in the future I'll add a webp to png converter