fread-ink / epub-cfi-resolver

A simple parser, resolver and generator for the EPUB-CFI format
GNU Affero General Public License v3.0
19 stars 3 forks source link

crash when using iframe document #5

Open mbret opened 3 years ago

mbret commented 3 years ago

Hello, I am trying to use this library with iframe but I get a crash error when passing the iframe document to the resolve function

image

image

Basically the undefined is expected to be a string here.

textarea.value return "" when created on the main page document but it looks like when creating with the iframe document it will be undefined.

Is that a specific behavior from iframe ? Is there a way to workaround ?

One thing to note is that the content in the iframe is an epub document and so is an xhtml page. Maybe the spec of xhtml define undefined instead of "" when a value has not been set yet or something ?

Juul commented 3 years ago

Can you share your code and xhtml document so I can replicate this error locally? Then I can try to figure out what's going on.

mbret commented 3 years ago

Sure I will try to create a snippet with iframe to showcase the issue and update this ticket 👍