HTML export not working under Chrome

Discussion and feedback on Construct 2

Post » Sat May 25, 2013 10:28 pm

I just exported a small project for a demo coder competition and ran into a pretty weird issue.

The exported index.html works just the way it should on Firefox but on Chrome, I'm merely greeted by a black background.

This is true for all my exports and I'm wondering why that is.

The app works just as it should inside preview mode (even when choosing Google Chrome) and as a Node-Webkit export.

Manually packaging Node-Webkit apps (i. e. outside of Construct 2) stopped working with Construct 1.30 HTML exports, as well. Now all that happens whenever I execute such a self-packed app is a message window popping up, telling me that I can't use the HTML offline while also retaining the black background with nothing on it.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Sat May 25, 2013 10:48 pm

What does the console says when you check for errors in the browser ?

Edit: Investing a bit more, this only happens when you try to execute the project in offline mode (locally on the computer if you will), which isn't an expected way to do.

Host the project online and execute it, that's the intended way of executing HTML5 projects.Kyatric2013-05-25 22:52:46
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat May 25, 2013 11:03 pm

[QUOTE=Kyatric] What does the console says when you check for errors in the browser ?

Edit: Investing a bit more, this only happens when you try to execute the project in offline mode (locally on the computer if you will), which isn't an expected way to do.

Host the project online and execute it, that's the intended way of executing HTML5 projects.[/QUOTE]

Here's the output:

Viewport target-densitydpi is not supported. | index.html:9
Uncaught Error: SecurityError: DOM Exception 18 | c2runtime.js:1740

The first one is pretty normal though, since it got deprecated a few months ago.

I do need to get this working offline, since that's what the jury asks for.

Lastly, I see no reason why such a project wouldn't run offline on it's own (aside of Google Chrome not being able to access the appcache or something like that, which I haven't yet checked). All my manually coded HTML projects do.

EDIT: Never mind. Found out that this is due to Google Chrome's own security policies. Can't really fix it without stripping my demo off the pathfinding Webworker. The only solution I could find is to run Google Chrome with the "--allow-file-access-from-file" Chromium flag.

Still weird that the same would also happen with manual Node Webkit builds. The only obvious thing that has changed since the version I used previously is the inclusion of jquery 2.0 and the fact that, by default, Index.html no longer looks for Jquery on it's official website.Blinx1232013-05-25 23:18:39
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Sun May 26, 2013 2:57 am

You mean you're running your exported project from disk? That's never been supported. You have to upload projects before they work.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Mon May 27, 2013 8:16 am

[QUOTE=Ashley] You mean you're running your exported project from disk? That's never been supported. You have to upload projects before they work.[/QUOTE]

It has always worked (and still does), actually. Just not under Chrome or IE.

Firefox doesn't prohibit the use of offline cookies, so HTML exports work fine locally.

The one thing that's still puzzling me is why manual Node-Webkit exports stopped working for me with R130. My build script is pretty simple and doesn't really do anything esoteric.

[CODE]
#MakeNode.ps1
$date = Get-date -format "dddd-dd-MMMM-yyyy_HH.mm~ms"

CMD /C Sevenzip a -t7z -r "C:\users\$env:username\downloads\node-webkit-v0.5.1-win-ia32\node-webkit-v0.5.1-win-ia32\Package.7z" "C:\users\$env:username\desktop\Powershell Prsentation1\*.*" > C:\Log.log

mkdir -p C:\users\$env:username\downloads\node-webkit-v0.5.1-win-ia32\node-webkit-v0.5.1-win-ia32\$date

CMD /C Copy /b C:\users\$env:username\downloads\node-webkit-v0.5.1-win-ia32\node-webkit-v0.5.1-win-ia32\nw.exe+package.7z C:\users\$env:username\downloads\node-webkit-v0.5.1-win-ia32\node-webkit-v0.5.1-win-ia32\$date\package.exe
[/CODE]

Never mind that I still need to add a few lines, copying the rest of the Node-Webkit to the output folder. I currently do that manually (blame lazyness). Still, the script should (and, in fact, did) work properly.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Mon May 27, 2013 10:52 pm

Running exported HTML5 websites from disk has never been supported. That means it may or may not work, but if it doesn't work, we are not going to fix it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, humanescape, MinecraftM153 and 4 guests