Comments (17)
Now, appjs never really stored anything AFAIK. However Deskshell is based off Chromium. So maybe it has to do with the chrome-profile folder, or the access to it. But that is where such data is supposed to be stored as far as I know... o.o
@sihorton might be the better guy here, I am just guessing ^.^
Am 22.10.2013 um 17:32 schrieb Jin Lu [email protected]:
WebSQL database and local storage get lost after restart
same issue as: appjs/appjs#374
—
Reply to this email directly or view it on GitHub.
from appjs-deskshell.
I have taken a look into this issue but have not found the solution yet. We are using chromium portable: http://portableapps.com/apps/internet/google_chrome_portable but then calling chrome.exe directly instead of the chrome portable exe. I don't see any settings in the download for save directories or the like. We pass in a profile directory so ideally it should save into that directory. We will need to setup a test application and then try to find out where it is saving the settings and then why it is loosing them.
If we can find a different chromium install for windows that does work with WebSQL / local storage then I am willing to switch to that.
As a work around nodejs gives you access to sqlite3 database, if you use this approach then you won't be limited to the 5 meg storage that chromium gives you but can instead have unlimited database size. Likewise node can write out json file directly to disk so you can save unlimited data to the client hard disk if needed rather than the limited amount supplied by chromium.
However even if the workaround is nicer than the built in html5 api's it is best for us to support them since it will be expected to be available and keeps code compatible with standard website code.
from appjs-deskshell.
@sihorton : I created a test app few weeks ago, and I assume all local data should be saved in directory: ...\AppData\Local\Deskshell-apps\mytestapp , it would be nice to have a configurable setting like "CachePath" in appjs which control the path.
does google_chrome_portable support runtime parameter like --user-data=DIR ?
from appjs-deskshell.
In app.js if you create a file "test.json" then that will be saved in "...\AppData\Local\Deskshell-apps\mytestapp" however if you use built in chrome functions then they will be saved in the user profile directory (AppData\Local\Deskshell\bin\win\chrome-profile).
This site lists all of the command line switches we can pass into chrome: http://peter.sh/experiments/chromium-command-line-switches/.
Deskshell is simple javascript so we just boot off chrome.exe with a list of switches (bin/win/node_modules/deskshell-api/index.js line 230 is where we set the switches). It is even possible to add additional parameters yourself by passing in "chromiumFlags" as a parameter to deskShell.startApp function call in app.js
We pass in "--user-data-dir=../../../../chrome-profile" as well as --disable-translate, --app-window-size, --remote-debugging-port and --app.
It should be possible to get the local storage / websql working if we just play around a bit. In your test app do you see any files being created in the chrome-profile directory while the app is running?
from appjs-deskshell.
@sihorton I can see a directory is created in chrome-profile\Default\databases when my app is running, but the name of directory is like: http_localhost_54246, I guess deskshell use a random port each time, so it can not find the data that it created with another port.
from appjs-deskshell.
Ah, ok that makes sense :-)
Just open your MyApp.desk file and add the port you want to use:-
,"port":8190
Then the application will always use port 8190 instead of a new one each time :-)
from appjs-deskshell.
@sihorton thanks it works! can you give a example to modify parameter "--user-data-dir=../../../../chrome-profile"? can I do it in MyApp.desk ? I really want to save all my data in "...\AppData\Local\Deskshell-apps\mytestapp\data"
from appjs-deskshell.
Great, glad that it is working now :-)
Since the profile directory wants to be relative to the current application directory can you try the following in your app.js file?
var running = deskShell.startApp({
chromiumFlags:[
'--user-data-dir='+__dirname+'\data'
]
});
I am not 100% sure that this will work since we will end up sending in 2 user-data-dir flags to chrome. However if it does not work I could do a new deskshell release which allows you to turn off the default profile dir. Can you first try the above change?
from appjs-deskshell.
thx @sihorton I tested above code but it's not working. all data are still saved in "chrome-profile" directory.
from appjs-deskshell.
Ok, sorry that did not work, I have updated the deskshell code to support a new parameter just for you :-)
For now download the following file http://deskshell.org/tmp/index.js and save to AppData\Local\Deskshell\bin\win\node_modules\deskshell-api\index.js
Then change your app.js to the following:
var running = deskShell.startApp({
"user-data-dir":__dirname+"/data"
})
Then hopefully the data dir will now be stored under your application. Let me know if it does not work and I can send you an example application setup to store its data directory as you requested. I will add this fix to the standard deskshell release so next update it will be available for everyone.
from appjs-deskshell.
thanks @sihorton now it works perfectly!
from appjs-deskshell.
Great :-)
from appjs-deskshell.
Hi Simon,
Just a quick head's up to say a big thanks for your fantastic work. I'm
finally getting a chance to play with deskShell a bit and it's super
slick -- great fun!
Have a great day,
-Chris
from appjs-deskshell.
Thanks Chris :-)
If you just run deskshell the demo app that opens should contain a little tutorial, docs and some demos. Let me know if we need to improve any of the explanations!
from appjs-deskshell.
It all works amazingly well so far. Super simple + very slick. Kudos!
-Chris
Thanks Chris :-)
If you just run deskshell the demo app that opens should contain a
little tutorial, docs and some demos. Let me know if we need to
improve any of the explanations!—
Reply to this email directly or view it on GitHub
#17 (comment).
from appjs-deskshell.
Which port of Deskshell are you testing? :)
Am 05.11.2013 um 21:11 schrieb Chris Banford [email protected]:
It all works amazingly well so far. Super simple + very slick. Kudos!
-ChrisThanks Chris :-)
If you just run deskshell the demo app that opens should contain a
little tutorial, docs and some demos. Let me know if we need to
improve any of the explanations!—
Reply to this email directly or view it on GitHub
#17 (comment).—
Reply to this email directly or view it on GitHub.
from appjs-deskshell.
Hi Ingwie -- not quite sure how I managed to hijack this thread (sorry!)...
...I'm using the default Node version. Is there an easy way to try/test your php version as well? I'm guessing that Documentation is probably the biggest missing piece at the moment??
-Chris
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.