How to use "--file-download-options" with "onCompleted"
Homework
- I took the time to write a good, descriptive issue title
- I read
nativefier --helpand API.md. - I checked CATALOG.md for community suggestions & workarounds.
- I searched existing issues, open & closed. Yes, my question is new.
- I'm running the latest version.
Your question
Hello :)
I have a question regarding the "--file-download-options" Option. There are many examples with the "saveAs" flag but I found not a single example how the "onCompleted" Flag works. Specifically how do i create a Nativefier command with it / how is the correct syntax?
My Problem: A Customer wants so show a website that runs a workforce managment system. The Users are not allowed to play around with the browser and surf the web. So Nativefier was the prefered choice. On this website is also a Messanger Tool where Users can send Files to each other.... So far so good.
Right now, each time a user clicks on a download Button of a File inside the Messanger the Windows Explorer Opens so the User can save the File.
The goal: If a User gets sent a PDF File and another user clicks on it, then a new Browser Windows should open that PDF File.
I have no real experience with JS and how the syntax works. Atleast I think that the Code should be something like "window.open(file)" but I have no idea how to pass it to the "onComplete" Flag or how thy correct syntax would be.
Or maybe there is an even easier way to do it....
thanks in advance :)
Steps to reproduce
nativefier --verbose --some-option https://mysite.com
<paste your verbose build logs, if relevant to your question>Debug info
No response
Nativefier version
52.0.0
Node.js version
18.16.1
npm version
8.1
OS
Windows 10
Source: nativefier/nativefier