Would like to suggest that local HTML files could be native-fied as well.
+1
I love this idea. Going to give it a shot later tonight.
+1
Any progress here? When I attempt nativefier http://app.local it's doing a lookup at googles DNS 8.8.8.8.
@snellingio anything ? else I'll give it a try over the weekend :)
Somework seems to have goine into this in #48, but I'm not sure why the PR was closed
@debopamsengupta But feel free to go ahead!
Any news on this?
if you've got a 'net connection try using ngrok (https://ngrok.com/) and a local http server, works well I find
I just made a proof of concept with a local file on Windows 7 - 32 bits that is working. It seems you just need to modify the file nativefier.json. Change the default value for "insecure" to true.
I don't know yet if it is working on other OS and what can be done to minimize the security risk when that value is true. Feel free to put a note here if you can confirm the solution is working for other OS or if you have any idea to prevent potential security nightmare when you do that.
{"name":"MY_APP",
"targetUrl":"file:///./maquette/MY_LOCAL_FILE.html",
"counter":false,
"width":1280,
"height":800,
"showMenuBar":false,
"fastQuit":false,
"userAgent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
"nativefierVersion":"7.1.0",
"ignoreCertificate":false,
"insecure":true, <---- CHANGE DEFAULT VALUE TO true.
"flashPluginDir":null,
"fullScreen":false,
"maximize":false,
"zoom":1,
"internalUrls":null}
It's actually just the validator package, if we are able to disable it, using file:// _should_ work.
Insecure just causes the chromium backend to ignore the browser mixed content errors https://github.com/jiahaog/nativefier/blob/da637ebf73b10241a67b766fbfc5ea84839f02b3/docs/api.md#insecure 馃槃
For anyone else having this issue a workaround is:
1) Package your app with a bogus url. For example
nativefier --name "SomeAwesomeApp" --insecure --ignore-certificate index.html
2) Navigate to the folder that was created and drop all of your files into the base directory (so they are at the same level as SomeAwesomeApp.exe)
3) Navigate to resources\appnativefier.json
a) Change the targetURL to "targetUrl":"file:///index.html"
4) It will run with the local html pages/js/css/images/etc.
This doesn鈥檛 address the issue directly, but, as a workaround, you could use a simple desktop web server such as Fenix Web Server or T猫s猫v猫. It takes next to no time to get going, and works well enough for Nativefier.
I'm using now which allows you to also deploy static stuff such as html "serverlessly".
E.g. Static Websites
$ my-site/ ls
index.html logo.png
$ my-site/ now
Every time you deploy a project, now will provide you with a new, unique URL, which you might use with nativefier.
For anyone else having this issue a workaround is:
- Package your app with a bogus url. For example
nativefier --name "SomeAwesomeApp" --insecure --ignore-certificate index.html- Navigate to the folder that was created and drop all of your files into the base directory (so they are at the same level as SomeAwesomeApp.exe)
- Navigate to resources\appnativefier.json
a) Change the targetURL to"targetUrl":"file:///index.html"- It will run with the local html pages/js/css/images/etc.
This indeed seems to work on Windows, however, I can't get it to work on Ubuntu. It works only if I specify full, absolute path to the index.html. Any workaround for this?
For anyone else having this issue a workaround is:
- Package your app with a bogus url. For example
nativefier --name "SomeAwesomeApp" --insecure --ignore-certificate index.html- Navigate to the folder that was created and drop all of your files into the base directory (so they are at the same level as SomeAwesomeApp.exe)
- Navigate to resources\appnativefier.json
a) Change the targetURL to"targetUrl":"file:///index.html"- It will run with the local html pages/js/css/images/etc.
I can't get it to work on OSX. It does not displays the html file.
And I am assuming we still have a way of doing this, on all platforms!?
Having the same issue here.
The problem on OSX is that no matter where you run the electron app, your "working" directory is "/", so it looks for the index file at the root. We would need a build of Nativefier that sets the working directory to the same directory the app is in, which is the default on Windows.
Would really appreciate an option to make this possible cross platform. Seems like a potentially neat and straight forward way of distributing basic html/js apps.
Most helpful comment
For anyone else having this issue a workaround is:
1) Package your app with a bogus url. For example
nativefier --name "SomeAwesomeApp" --insecure --ignore-certificate index.html2) Navigate to the folder that was created and drop all of your files into the base directory (so they are at the same level as SomeAwesomeApp.exe)
3) Navigate to resources\appnativefier.json
a) Change the targetURL to
"targetUrl":"file:///index.html"4) It will run with the local html pages/js/css/images/etc.