Webstorage removed from Chrome Apps?

Discussion and feedback on Construct 2

Post » Sat Dec 06, 2014 12:16 am

Noticed that r191 included the following changelog notice:

WebStorage: worked around crash caused by the fact Chrome Web Store apps have removed local storage support. WebStorage now does nothing in Chrome Web Store apps. We have requested that Google add support back.


This seems like kind of a big deal.:?

I can't test this myself ATM, but I was wondering if anyone else has noticed this or would be willing to confirm it?

Here's Ashley's chromium bug report; please chime in if you are seeing the same issue:

https://code.google.com/p/chromium/issu ... ?id=439027
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Dec 06, 2014 1:50 am

Hi,

Does this mean that we can no longer use the webstorage local feature to save game data and setting etc?

Thanks
B
6
S
1
Posts: 38
Reputation: 417

Post » Sat Dec 06, 2014 1:59 am

What about cookies?
Image ImageImage
B
169
S
50
G
169
Posts: 8,285
Reputation: 108,214

Post » Sat Dec 06, 2014 2:15 am

@newt

Last time I checked, they're good with milk. :lol:

Seriously, though, I think there was a C2 plugin that let you set normal cookies, but they aren't secure ie., the user can easily see and modify them (my hi scor iz 9,999,999,999,007!!!).

So, that's a drawback.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Dec 06, 2014 2:20 am

If they can maip cookies, then they are smart enough to get at webstorage too.
Just looking at workarounds as always.
Image ImageImage
B
169
S
50
G
169
Posts: 8,285
Reputation: 108,214

Post » Sat Dec 06, 2014 2:41 pm

I think the savegame system will still work, because internally it uses IndexedDB first if it's supported, and I think Chrome apps still support that. Unfortunately if Chrome don't support localStorage again then the WebStorage object will do nothing in Chrome apps (writes will be ignored and reads will return empty).
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Sat Dec 06, 2014 4:46 pm

@Ashley
This situation is very unfortunate however as a place holder to maintain WebStorage and legacy. Why not in the meant time shim local storage. At least until Google finally capitulates and brings back localstorage; which is silly to remove.

indexDB loads the save information when the app starts. This is done prior to any WebStorage the c2 app uses.
All use of WebStorage localstorage works only on temporary in memory data.

then developers can make a choice on how often the temp storage is saved to the asynhronous long term storage(indexDB?)
1. On change.
2. On Layout change
3. Only on Action

This way the old system doesn't break as synchronous data storage is maintained. Speed(negligible) is improved as it's always memory storage.

Alternatively there could be a more advanced storage system. There is the one above that could be simple and automated. However the one above I would have concerns about large groups of data using lot's of memory. So an option would to provide an AJAX style memory system for large blobs of data and the above sample for small chunks.

And finally I would also like to add this.
local storage and session storage by default without user intrusion have limits of 5mb each. To by pass that 5mb require permissions and or user request. 5mb is small, but fine most of the time.

indexDB offers 50mb as a base storage before requiring user intrusion to functioning of the app.

So there are solutions to the problem. I don't really feel that the suggestions are hacky, but instead more in line with the intention of how indexDB should work. Instead of assuming that every piece of information is now based on ajax. Now the main storage Dictionary is ajaxed.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Sat Dec 06, 2014 5:02 pm

This is awful, we all need to msg chrome and let them know we need that in our engine.
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Sun Dec 07, 2014 12:37 am

@jayderyu - it's a good idea, but it's probably going to be slow or flakey - either you write the entire storage on every change, which if you make 100 changes in a row with 1mb of local storage means you immediately run 100mb of writes, or you batch them up on a timer or some such, and then you simply lose data if the user quits before the writes happen. There could be an action to flush WebStorage, but then it only exists for a single platform and does nothing else anywhere, and you still have a new porting barrier since to make an existing project work on the CWS you need to go through adding "flush storage" actions in the right places.

I really don't like the fact the Chrome team are willing to turn off random web platform features, since it bodes very badly for portability of existing web content, so I don't think it's even in their interest to do it! I don't want to encourage them to do it again, so I'd rather fight this case and get it put back than find a workaround.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Sun Dec 07, 2014 1:18 am

@Ashley
good luck on the fight. I think turning off localStorage is silly and a feature that should be restored.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jobel, paxto22 and 3 guests