Comments (4)
This is a complex issue since chrome (the window) starts its own process and then exits immediately. Also sometimes chrome decides to "join" or re-use an existing browser process that is running, this means that it is quite difficult to detect when the window process closes. However the code is getting better on this point. Try the following:-
-
Make sure that you have:
"exitOnAppWinClose": true
in your app.desk as this will tell node.exe process to exit once the window exits. -
Add an on window unload event in your application. This will get called when the window is closed, in this function you can then send a socket message to nodejs and tell it you are exiting. Node can then do process.exit() to terminate itself.
We are still looking for best practices to solve this issue, as we discover good solutions we can update the main deskshell implementation.
from appjs-deskshell.
Thanks for replying.
Since a version of chrome which i can't call out.The event window.onunload is desperated, and it won't work any more.
I have a hack way to fix this up, using the chrome extension as that we can make it default to manage window's clos e event,but there still have some problem that Chrome Extension API work strange.API chrome.windows.onRemoved doesn't work every time.So sad and I can't figure this out.
from appjs-deskshell.
We will be moving to a cef3 based browser instead of chrome soon (code is working on mac already). This should solve the problem, when lanching the window we will get the process id and then know when it closes. This should fix the entire issue as well as give further benefits. So if you can live with the issue for now it should go away soon.
from appjs-deskshell.
I use window.onbeforeunload event instead of window.onunload because the window.onunload also trigger when refresh the window, which is unwanted.
from appjs-deskshell.
Related Issues (20)
- Compiling Windows .exe stuck on compiling app.nsi HOT 12
- Chrome crashes when running the app
- Kiosk app .exe close button not working
- Use built-in webkit browser instead of using chrome HOT 1
- Portable Windows Hello World not running
- Local node_modules HOT 1
- Use Chromium instead of Chrome HOT 1
- Running Deskshell only runs a Chromium Browser HOT 1
- How to debug packaged executable? HOT 16
- Your website is broken HOT 13
- deskshell.exe source code HOT 1
- zip on website is broken
- How to Digitally sign the Package HOT 1
- Your website deskshell.org is offline... HOT 6
- socket.io.js not found HOT 1
- Downloads broken? HOT 7
- Creating an app with a static port?
- Would this work on a non-gui operating system ?
- Is this project still actively developed? HOT 2
- Nothing happens in deskshell 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 appjs-deskshell.