gerhardsletten / react-reader

An ePub-reader for React, powered by Epub.js
https://react-reader.metabits.no
Apache License 2.0
676 stars 130 forks source link

Cannot open links from ePub #131

Closed avalero closed 1 year ago

avalero commented 1 year ago

Hello,

When loading an epub with an external link (target=_blank) I get the following error on Firefox/Safari/Chrome console

Blocked opening '<URL>' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.

and the link does not open.

I have looked for a prop to configure this behaviour, but I have not found any on the RenditionOptions interface.

If I right click on the links and click "Open on a new..." it works just fine.

gerhardsletten commented 1 year ago

@avalero You need to add allowPopups, see PR from epubjs here

<ReactReader
  epubOptions={{
    allowPopups: true
  }}
/>