Comments (21)
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\app\nativefier.json
a) Change the targetURL to"targetUrl":"file:///index.html"
- It will run with the local html pages/js/css/images/etc.
from nativefier.
Any news on this?
from nativefier.
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}
from 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\app\nativefier.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?
from 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\app\nativefier.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.
from nativefier.
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.
from nativefier.
+1
I love this idea. Going to give it a shot later tonight.
from nativefier.
+1
Any progress here? When I attempt nativefier http://app.local
it's doing a lookup at googles DNS 8.8.8.8.
from nativefier.
@snellingio anything ? else I'll give it a try over the weekend :)
from nativefier.
Somework seems to have goine into this in #48, but I'm not sure why the PR was closed
from nativefier.
@debopamsengupta But feel free to go ahead!
from nativefier.
if you've got a 'net connection try using ngrok (https://ngrok.com/) and a local http server, works well I find
from nativefier.
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 😄
from nativefier.
This doesn’t 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.
from 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.
from nativefier.
And I am assuming we still have a way of doing this, on all platforms!?
from nativefier.
Having the same issue here.
from nativefier.
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.
from nativefier.
I find a some weird but working on all platforms way:
- Compile Nativefier app with any target, eg:
nativefier -i icon.png --disable-context-menu --disable-dev-tools -n "Your App name" anything
- Put your website files to
nativefier_app_dir/resources/app/local
- Open
nativefier_app_dir/resources/app/lib/main.js
- Replace all the
options.targetUrl
withfile://${path.join(__dirname, '..', 'local/index.html')}
from nativefier.
Hi @azhinu, thank you for the workaround. I tried your solution and the first thing is I think you're missing a "`" at the end of the path to the local files. After fixed that Nativefier works, but when I try to open links it sends an error:
Uncaught Exception:
ReferenceError: path is not defined
at onWillNavigate (/Mypath/Contents/Resources/app/lib/webpack:/nativefier-placeholder/src/helpers/windowEvents.ts:135:15)
at EventEmitter. (/Mypath/Contents/Resources/app/lib/webpack:/nativefier-placeholder/src/helpers/windowEvents.ts:197:5)
at EventEmitter.emit (node:events:402:35)
You or somebody knows how to fix this??, There's something else to disable in nativefier??
Thank you very much
from nativefier.
Hi @tecmoc, I not clearly remember, but probably "`" symbol not missing at the end. It can be a wrong Markdown markup.
from nativefier.
Related Issues (20)
- Integrated application installation and removal
- Font cannot be decoded
- Difference with macOS Sonoma Web Apps? HOT 1
- Is there an option which support to run some custom scripts before launching the app? HOT 2
- Facebook Messenger does not use the whole window HOT 1
- WhatsApp push notifications don't work on macOS Ventura HOT 1
- Unable to log in using Windows Hello normally
- Playing DRM-protected video content not possible HOT 1
- How to enable Web Speech API feature?
- How is this different from doing Chrome > More Tools > Create Shortcut > Open as Window ? HOT 3
- Error when trying to build for Windows on Linux HOT 2
- silent print HOT 1
- Force mobile layout for site when user agent is not enough? HOT 4
- "https://messages.google.com/web" results in ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed HOT 3
- Creation fail
- How to use "--file-download-options" with "onCompleted"
- Js Alert window Autofocus to menubar
- How to display a print preview?
- Remember password functionality
- Nativefier is unmaintained HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativefier.