x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Html5 on itch.io

Product Version: UE 4.15
Tags:
more ▼

asked Feb 23 '17 at 10:31 PM in Packaging & Deployment

avatar image

Eryen
3 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I think the issue here is that itch.io has disabled dynamic code execution by enforcing what's called Content Security Policy (CSP). For detailed info about that, read e.g. https://developers.google.com/web/fundamentals/security/csp/

Parallel to that, Emscripten has adjusted to no longer use eval() in to avoid this issue (and also to optimize performance). That was this bug: https://github.com/kripken/emscripten/issues/2596. I believe UE 4.16 will have updated Emscripten which has this fix deployed.

Another way to work around is to get UE4 from source, and get latest Emscripten SDK, and build UE4 for HTML5 with the latest SDK manually. This is somewhat involved process though, mostly for internal developers, so might be more hassle than it's worth.

A second way to hack to workaround could be to "staticalize" the eval() function, by looking at all the code that is passed to eval(), and having static code paths which execute that code. This requires some technical debugging work, and might be a bit hacky. I did do that successfully for one project that needed to deploy on Facebook, which had similar kind of issue. The broad strokes for doing that would be to redefined the eval() function in the main page html file, with the following:

eval = function(s) { if (s === 's1') { s1; } else if (s === 's2') { s2; } else { console.error('Attempted to eval "' + s + '" but not yet supported!'); } }

and the idea is to find all the different strings s with which eval() is getting called, and create the blocks s1, s2, etc. for each of those strings. This might be a horrible thing to attempt, but technically that should work.

I'm not too familliar with itch.io, perhaps the cleanest way might be if they support disabling CSP on a page if it's not desirable, that would be a simplest workaround for the time being.

more ▼

answered Mar 08 '17 at 04:28 PM

avatar image

juj
1.2k 15 4 17

avatar image Eryen Mar 10 '17 at 06:10 PM

I´ll try to wait a bit, maybe it will be simplier later. My project was for school and we made a compromise so I don´t need to get to work trough itch.io. It would be cool thou. Anyway thank you for trying to help, maybe it will help someone else :).

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question