LoadString in Chrome Packaged App

Monkey Targets Forums/HTML5/LoadString in Chrome Packaged App

Evil Roy Ferguson(Posted 2013) [#1]
I ran into a few issues when compiling my app as a Chrome Packaged App and thought I might see if anyone else has any experience with this. The other issue (inline JavaScript in the main.html) was trivial to resolve but this one might be a bit trickier.

The JavaScript implementation of LoadString that monkey generates uses a synchronous AJAX request, which isn't supported in packaged apps. My solution was to just add a global STRINGS variable with the strings inlined, and return STRINGS[path] instead of trying to make the synchronous request. The problem with that approach is that this requires edits to main.js, and while it's not hard to automate them, I'd rather not. :P

Is there any equivalent to IncBin or anything so I can avoid the situation to begin with?


Snader(Posted 2013) [#2]
Can you show me the exact modifications you made to get this working?


rIKmAN(Posted 2013) [#3]
Seems you got it working snader, can you show us exactly what you did to get it working? :)


Snader(Posted 2013) [#4]
No I didn't actually... I decided to go with the legacy app type instead of the new packaged app.

I tried but when I coded all strings hard into my sourcecode I found out that fontmachine wasn't going to work either. So I went for the less beautifull way.