Nativefier: iframe to pdf will be downloaded

Created on 29 Apr 2020  路  6Comments  路  Source: jiahaog/nativefier

Bug description
When adding an iframe with src to an pdf file, chromium will display its pdf viewer inside the iframe.
Example:

<iframe src="https://example.org/test.pdf"></iframe>

will show the pdf viewer inside the iframe.
nativefier does not show the pdf viewer at all but starts downloading the file silently in the background.

Steps to reproduce

  1. Run nativefier "data:text/html;charset=utf-8,<html><body><iframe src="https://www.jena.de/fm/41/test.pdf"></iframe></body></html>"
  2. open generated app
  3. empty iframe is shown, example pdf is downloaded in background

Expected behavior
chromium pdf viewer should show the pdf file

Actual behavior
example pdf is downloaded in background

Debug info
Verbose logs (command-line and/or in app DevTools console), error message, screenshots

Context

  • Nativefier: (for example: 8.0.7)
  • Node.js: (for example: 10.16.3)
  • Npm: (for example: 6.9.0)
  • OS: (for example: Windows 10 build 1903)
bug

All 6 comments

i also tried enabling electron plugins in browserwindow options (https://stackoverflow.com/questions/43220321/electron-pdf-viewer) like:
--browserwindow-options "{ \"webPreferences\": { \"plugins\": true } }"
without success.

Yes, this is an issue. According to Electron docs, enabling

 webPreferences: {
    plugins: true
  }

would be enough to allow the PDF to be shown in the iframes, but it doesn't work.

Any suggestions?

Thanks.

I got it working by using electron 9 beta (-e param).
Stable release of electron v9 will be in a few days.

I got it working by using electron 9 beta (-e param).
Stable release of electron v9 will be in a few days.

@cyptus thanks, good to know! Will default to 9 a few weeks after it's released.

electron v9 stable has been released yesterday (https://www.electronjs.org/blog/electron-9-0).
see also https://github.com/electron/electron/pull/22131 which should be the issue that fixed this issue.

nativefier argument "-e 9.0.0" is still needed for me.
i think we can close this.

electron v9 stable has been released yesterday (https://www.electronjs.org/blog/electron-9-0).
see also electron/electron#22131 which should be the issue that fixed this issue.

nativefier argument "-e 9.0.0" is still needed for me.
i think we can close this.

@cyptus thanks! I just released Nativefier v9.0.0 which defaults to Electron 9.0.4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raulcraveiro picture raulcraveiro  路  4Comments

vegbrasil picture vegbrasil  路  4Comments

shnbhg picture shnbhg  路  5Comments

ranzou06 picture ranzou06  路  3Comments

DougBeney picture DougBeney  路  5Comments