I trying porting my App from WebPlayer to WebGL. WebGL App works fine in Chrome, but in Firefox I get the error: I using Unity5.1.0f1. 692 line of the output javascript code is the following code curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
The stack trace shows a call to CreateDirectory, which is not allowed In WebGL. This is probably called indirectly , for example by accessing Application.temporaryCachePath or a similar API.
@liortal Thanks My App dose not use CreateDirectory and Application path API. This problem is Firefox Only.
I recall seeing the same issue for our game. In our case, it happened due to a call to some API that attempts to create a folder (we did not call it directly). Is the stack you posted the full one? or is there more? Also, could you send the javascript console output?
I fixed this issue. My App using PlayerPrefs and ZDatabase asset. I have removed all of the writing and the reading of the code of PlayerPrefs, error was not out .
I'm having this same problem with LoadFromCacheOrDownload for my asset bundles. It works like a charm in Chrome, but I get this same error every time I try to yield return www in Firefox (Mac & Windows). I'm unable to reproduce the situation outside of my main application so I don't know if it is directly related to that call. In my main application, it's nested inside a few different coroutines. I can run the app fine in Firefox without asset bundles. I use PlayerPrefs in all 3 browsers without problems so it doesn't seem to be related to that for me. I still need to investigate further.
So are you saying that we're not allowed to use PlayerPrefs? As I mentioned, I use it very often for different things and it works great in Chrome. So is it only disallowed in Firefox?
No worries at all, I just wanted to make sure. What you mentioned about FileIO does possibly seem to relate to my issue, but I'm unsure still. I can call LoadFromCacheOrDownload in a new bare-bones project on the same asset bundle that fails in my main application. Perhaps using this method is doing some sort of FileIO that's causing issues only in certain situations? It seems to download the entire thing as it gets to 99% complete, but then I'm guessing it's the loading from cache that fails immediately afterwards.
Even FileIO should be supported I believe. I think this is a bug with asm.js in Firefox (probably not actually a Unity bug). The File IO stuff I think is wrapped and uses localStorage under the hood.
Ouch, seems like this bug has existed for awhile based off of other various reports I've seen floating around. Hopefully it's fixed at some point as I don't know how to proceed on Firefox at this point. Thanks for the input.
Hmmmm... I think it isn't related to PlayerPrefs, but to the WWW class. I saw on the forum other people reporting about "too much recursion" on firefox when downloading AssetBundles or large files. I think this was also a problem I saw on our project when tried to run it on firefox, but we wanted the WebGL version only on Chrome, so I didn't try to catch the real problem. try to remove the call to download AssetBundles. PlayerPrefs should be ok(but they won't work from an iframe as far as I know)
Thanks for the input on this. My app does, indeed, run fine when there is no asset bundle downloading even while using PlayerPrefs. But we have quite a bit of content, so I'm not so sure I want it all packed into the final build at this point. I am also mostly only concerned with Chrome at this point, but would still love to run on Firefox. As for not working in an iFrame, I've been running my webgl build in an iframe on Facebook and haven't run into any issues with PlayerPrefs so far.
If you have time - you can test it and send Bug report. @jonas echterhoff - do you know about this problem? And about the IFrame and PlayerPrefs, maybe it works on some of the browsers, but it doesn't suppose to, as it based on IndexedDB, which shouldn't work on IFrame for security reasons. maybe it isn't like that in all the browsers...
I did not write some of the information .My App is Facebook Canvas App. It seems to can not use PlayerPrefs is on the Facebook Iframe. But, there is a case where "PlayerPrefs will not be save" is displayed error console, Firefox error dialog "too much recursion" is displayed.
We were able to solve this issue by not caching our assetBundles if the browser is firefox. Also of relevance for large asset bundles was the solution posted in this thread: http://forum.unity3d.com/threads/quick-connection-timed-out.325297/ ...which disabled the timeout.
I have a one game which using lots of Playerpref and its working fine on firefox with iFrame.But i have another project which giving me " too much recursion" issue.It seems Playerpref is not responsible for this issue.Please let me know why this issue should be come and how should i solve it.