HTML5 exports are not loadable via https:// CDNs by default

When generating a HTML5 export of a project, the main .html file will have the following code:

	<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
	<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
	<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">

This is problematic if the page is hosted on a CDN via a https:// URL, since this will generate a security error that states that loading Mixed Active Content is not allowed (details at Mixed content - Web security | MDN).

It would be nice to have UE4 exported directories just host these three files locally, so that they could be loaded relatively with

	<script src="jquery-2.1.3.min.js"></script>
	<script src="bootstrap.min.js"></script>
	<link href="bootstrap.min.css" rel="stylesheet">

which would follow the same https:// or http:// protocols that the main page used. This would make hosted pages less resilient to outages from external jquery and bootstrap CDNs.

If this does not feel like a good solution, then another method would be to create a dynamic JS script that loads these files, which loads the scripts by reusing the JS global “location.protocol” field, which is either a string “https:” or a string “http:”, depending on which one was used to load the current URL.

This change would fix e.g. the issue reported here: Fixes to play HTML5 builds on Itch.io - Platform & Builds - Epic Developer Community Forums, and also make UE4 builds directly hostable via copying to dropbox, which uses https:// hosting.

This issue also affects a similar feature that the analyics info that UE4 exported games send back home will fail to load and crashes the page.

This will look like an error "Blocked loading mixed active content

The fix to that would likely be that the data collection server is enabled to accept https (if it isn’t so yet), and on client side the metrics upload is updated to read the “location.protocol” field to choose which type of protocol to use to upload.

Although, now to think of it, I believe it should be safe to just always use https:// in all of these locations - that shouldn’t cause any extra trouble.

i’ve put in a fix yesterday after finally getting to the itch.io answerhub issue. this fix will be available in 4.13. (it might go in as hotfix for 4.12 – but not sure about that…)