00:00
00:00
Newgrounds Background Image Theme

Nardballs just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Local Storage not working

982 Views | 12 Replies
New Topic Respond to this Topic

I've uploaded the exact same html project .zip to both Newgrounds and Itch.io. On Itch, changes to the level are saved when you refresh the page, however this doesn't work on Newgrounds. Have you guys noticed any issues with this on html projects? have you noticed games not saving when they say they do.

Edit: above portal link says ~4 stars, when it's only 3 stars


@tom can you see any reason that the issue would be on NG's end?

Response to Local Storage not working 2019-01-01 19:41:02


Can confirm. On a whim, I was playing Necronomicon BoDN (because it's fun), and noticed that I was not saving data, game to game. No scores, achievements, or otherwise are being stored. You click away from the page and it's gone.


<INSERT SIGNATURE HERE>


Don't think I've noticed any issues with HTML games in particular, but I did run into an issue with the Drawing Grounds today, in that I drew a round, saved it, and was returned back to the menu... without it having been saved at all. Assumed it was a temporary connection issue but maybe that's local storage too. All entries are saved under User Creations if you so choose. Second time it worked fine though...


The latest: Hexa #97 (May)

BBS Signature

Response to Local Storage not working 2019-01-06 00:08:08


Well, it's ongoing and not just a random glitch, unfortunately. Is there someone technical and support-based that I can poke at in an official way and ask for it to be looked at?


<INSERT SIGNATURE HERE>


At 1/6/19 12:08 AM, Lazydaemon wrote: Is there someone technical and support-based that I can poke at in an official way and ask for it to be looked at?


Perhaps @psychogoldfish ?

I think games are pretty low on the priority list, right now. what with all the tumblr refugees being a decent source of supporters

Response to Local Storage not working 2019-01-06 15:56:47


At 1/6/19 12:10 AM, GeoKureli wrote:
At 1/6/19 12:08 AM, Lazydaemon wrote: Is there someone technical and support-based that I can poke at in an official way and ask for it to be looked at?
Perhaps @psychogoldfish ?
I think games are pretty low on the priority list, right now. what with all the tumblr refugees being a decent source of supporters


Yeah...not interested in site politics. A fundamental function of the site isn't working. If it's not something I can solve at my computer, the people here have to look into it, because something is broken and will not improve with age. If you're getting more support because of what happened at Tumblr, hire more people. Don't be like Google's mishandling of Youtube.


<INSERT SIGNATURE HERE>


At 1/6/19 03:56 PM, Lazydaemon wrote:
Yeah...not interested in site politics.


That was all speculation on my part, so take it with a grain of salt. Last I heard, Tom is still operating this site with money from his own pocket, so hiring may not be feasible.


Anyway, yeah I'll PM them directly since this is affecting my content and I'm not getting a response

Response to Local Storage not working 2019-01-06 16:10:42


At 1/6/19 04:05 PM, GeoKureli wrote:
At 1/6/19 03:56 PM, Lazydaemon wrote:
Yeah...not interested in site politics.
That was all speculation on my part, so take it with a grain of salt. Last I heard, Tom is still operating this site with money from his own pocket, so hiring may not be feasible.

Anyway, yeah I'll PM them directly since this is affecting my content and I'm not getting a response


Did that just a couple minutes ago with a link to here, adding a bit of info that I was checking a few other games to make certain.


<INSERT SIGNATURE HERE>

Response to Local Storage not working 2019-01-07 09:53:06


At 1/1/19 03:57 PM, GeoKureli wrote: I've uploaded the exact same html project .zip to both Newgrounds and Itch.io. On Itch, changes to the level are saved when you refresh the page, however this doesn't work on Newgrounds. Have you guys noticed any issues with this on html projects? have you noticed games not saving when they say they do.
//www.newgrounds.com/portal/view/723552
Edit: above portal link says ~4 stars, when it's only 3 stars
@tom can you see any reason that the issue would be on NG's end?


One thing we do a little different than sites like itch.io is that we host games in a sandboxed iframe. The iframe itself bocks access to the container page, and all games are hosted on a separate domain to ensure people can't scrape private information like user cookies or anything like that.


This security seems to be the root of the issue with your game. If you load it directly at http://uploads.ungrounded.net/alternate/1288000/1288914_alternate_70507_r4.zip/ the levels save just fine.


I took a look at your source files to see where you may be having problems and noticed whatever haxe framework you are using isn't using the html5 localStorage API at all. There's a FileSaver.js class that's trying to autodetect the "_global" scope, and I think that is where things are failing.


Unfortunately, there's nothing we can do on our end to just make your game work. You might get better support contacting whoever manages the framework you are using. They simply may have never tested exporting on a setup like ours (lots of devs test on a server they control, and if it works they they just assume it works everywhere).


If you can figure out how to replace their save method with the localStorage API, that should work better for you. I've used that myself in Pixel Day Dash and it works great.


At 1/7/19 09:53 AM, PsychoGoldfish wrote: I took a look at your source files to see where you may be having problems and noticed whatever haxe framework you are using isn't using the html5 localStorage API at all. There's a FileSaver.js class that's trying to autodetect the "_global" scope, and I think that is where things are failing.


Thanks for the reply, we are actively looking into it.


ignore FileSaver.js, it's unrelated. we are using the HTML5 local storage API, but it looks like your game uses "localStorage" where mine uses window.localStorage"


Pixel Day Dash Code


Dial-A-Platformer Code 1

Dial-A-Platformer Code 2


if anything jumps out to you as an obvious issue, let me know

Edit: in my code localPath is https://uploads.ungrounded.net/alternate/1288000/1288914_alternate_70507_r5.zip


Found the issue, it's saving with the uploads.ungrounded localPath but it's including the url params in that path. so every time the url params change the old save file is inaccessible. this is a framework issue, not a NG issue. I'll update the thread if a fix is made, in case other openfl devs comes here looking for info.


For instance, these 2 links have separate save files:

https://uploads.ungrounded.net/alternate/1288000/1288914_alternate_70507_r5.zip

https://uploads.ungrounded.net/alternate/1288000/1288914_alternate_70507_r5.zip?somevar=foo

Response to Local Storage not working 2019-01-08 19:11:39


This issue has been fixed on the develop branch of OpenFL. Thanks to all who helped!

https://github.com/openfl/openfl/commit/b6cce77c5dcdf5096f119a1476a7493919c8a1fd

Response to Local Storage not working 2019-01-09 14:47:33


At 1/8/19 07:11 PM, GeoKureli wrote: This issue has been fixed on the develop branch of OpenFL. Thanks to all who helped!
https://github.com/openfl/openfl/commit/b6cce77c5dcdf5096f119a1476a7493919c8a1fd


Awesome to see how issues like this actually get solved. :) Thanks for bringing this thing up and all.


Though seems like some games will still have similar issues...

The latest: Hexa #97 (May)

BBS Signature