Giter VIP home page Giter VIP logo

Comments (17)

IngwiePhoenix avatar IngwiePhoenix commented on July 4, 2024

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.

sihorton avatar sihorton commented on July 4, 2024

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.

lvbeck avatar lvbeck commented on July 4, 2024

@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.

sihorton avatar sihorton commented on July 4, 2024

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.

lvbeck avatar lvbeck commented on July 4, 2024

@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.

sihorton avatar sihorton commented on July 4, 2024

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.

lvbeck avatar lvbeck commented on July 4, 2024

@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.

sihorton avatar sihorton commented on July 4, 2024

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.

lvbeck avatar lvbeck commented on July 4, 2024

thx @sihorton I tested above code but it's not working. all data are still saved in "chrome-profile" directory.

from appjs-deskshell.

sihorton avatar sihorton commented on July 4, 2024

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.

lvbeck avatar lvbeck commented on July 4, 2024

thanks @sihorton now it works perfectly!

from appjs-deskshell.

sihorton avatar sihorton commented on July 4, 2024

Great :-)

from appjs-deskshell.

ZermattChris avatar ZermattChris commented on July 4, 2024

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.

sihorton avatar sihorton commented on July 4, 2024

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.

ZermattChris avatar ZermattChris commented on July 4, 2024

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.

IngwiePhoenix avatar IngwiePhoenix commented on July 4, 2024

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!
-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).


Reply to this email directly or view it on GitHub.

from appjs-deskshell.

ZermattChris avatar ZermattChris commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.