Exported as HTML5 Website - Black Screen on Chrome

Bugs will be moved here once resolved.

Post » Sat Jan 05, 2013 10:18 pm

Recently I observed that C2 games exported as "HTML5 Website" give only a black screen while trying to open the index.html file locally using Chrome web browser.

However these games work as expected when I try to preview with Chrome or when I access the index.html as a URL in dropbox using Chrome.

Above issue is only found in Chrome web browser and didn't have any issues with IE9 and Firefox 17.0.1.

Following is the tested environment

Software
- Microsoft Windows XP Service Pack 3
- Scirra Construct 2 Release 114 (32 bit)
- Firefox 17.0.1
- IE 9
- Chrome Version 23.0.1271.97 m

Hardware
- RAM: 2GB
- Processor: Intel Core 2 Quad CPU 2.66GHz
- Graphics Card: NVIDIA GeForce 9600 GT


Steps to Recreate the Issue

To recreate the issue I have used the "8 direction 1 (simple movement).capx" file available with C2 as an example project. In case you want to make sure that I am using an unmodified file, I have kept that .capx in https://dl.dropbox.com/u/105699697/8%20direction%201%20%28simple%20movement%29.capx

1) Open the file in Scirra Construct 2 Release 114 (32 bit)

2) Preview in Chrome web browser [WORKS]

3) Export as "HTML5 Website"

4) Go to the exported folder and open index.html using Chrome web browser [ONLY BLACK SCREEN]

5) Go to the exported folder and open index.html using Firefox [WORKS]

6) Go to the exported folder and open index.html using Internet Explorer [WORKS]


After that I uploaded the exported content to dropbox and accessed following URL using Chrome web browser.
https://dl.dropbox.com/u/105699697/8-direction/index.html

This time it worked as expected.So the black screen is coming only when I try to open index.html file locally using Chrome web browser.

Opening the game using index.html in a local folder is required for me, because I want to share the exported games with some people who do not have direct access to dropbox.

In case you want to check the exported content, I have shared that it in following URL.
https://dl.dropbox.com/u/105699697/8-direction.zip

I would appreciate if you can help with checking this issue.







Ramesh2013-01-05 22:20:24
B
21
S
6
G
11
Posts: 30
Reputation: 5,396

Post » Sat Jan 05, 2013 10:53 pm

"Projects do not run from disk (the file:// protocol). Browser security limitations generally prevent projects from working when on disk. So we don't support this at all and it's no surprise if your project doesn't work there. Didn't you see a browser prompt telling you that? I added an alert when running on the file:// protocol that should say "upload this project before trying it"."

Quoted from Ashley.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Sun Jan 06, 2013 2:01 am

[QUOTE=Ramesh] Recently I observed that C2 games exported as "HTML5 Website" give only a black screen while trying to open the index.html file locally ...[/QUOTE]
This is completely normal behavior, as thehen points out. Note that you're exporting your project as a HTML website, so index.html is intended to be delivered by a web server, not as a local file.

[QUOTE=Ramesh]Opening the game using index.html in a local folder is required for me, because I want to share the exported games with some people who do not have direct access to dropbox.[/QUOTE]
If you do want to open index.html locally, the only sure-to-work method is for you to set up a local web server (e.g. WAMP) and have that deliver index.html to your browser.Velojet2013-01-06 02:02:57
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Sun Jan 06, 2013 8:21 am

[QUOTE=thehen] "Projects do not run from disk (the file:// protocol). Browser security limitations generally prevent projects from working when on disk. So we don't support this at all and it's no surprise if your project doesn't work there. Didn't you see a browser prompt telling you that? I added an alert when running on the file:// protocol that should say "upload this project before trying it"."

Quoted from Ashley.[/QUOTE]
Thanks @thehen

Sorry I missed the following forum topic in the "How do I....?" section.
http://www.scirra.com/forum/blank-screen-after-exporting_topic50769.html

When I searched with the text "upload this project before trying it", I found it. Thanks!

[QUOTE=Velojet]
This is completely normal behavior, as thehen points out. Note that you're exporting your project as a HTML website, so index.html is intended to be delivered by a web server, not as a local file.[/QUOTE]
Thanks @Velojet

When I was developing a game for Scirra Rotary Competition in February 2012, I tested that game in many browser versions by opening index.html from a local disk (the file:// protocol). And I am sure that it worked well on all browser versions including Chrome at that time. After that also I tested this many times on Chrome without issues. So it was not the "Normal Behaviour" with some previous versions. That's why I was wondering why it is not working now. And with current versions also, this black screen is only coming with Chrome and it shows following error in JavaScript console of Chrome.

Failed to load resource file://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
Uncaught Error: SECURITY_ERR: DOM Exception 18 c2runtime.js:54

[QUOTE=Velojet]If you do want to open index.html locally, the only sure-to-work method is for you to set up a local web server (e.g. WAMP) and have that deliver index.html to your browser.[/QUOTE]
Yes, actually I have an Apache HTTP server in my machine and I have hosted the game in it. Unfortunately the people I want to share this with are in a different network (a different secured VLAN) which prevents access to my machine as a result of some security configurations. And they do not have access to dropbox.

Personally I feel asking them to setup a local web server just to check my game is bit of additional work for them. Since this is anyway working with IE9 and Firefox, I will ask them to install one of those browsers, because it is easier for them.

Anyway thanks for all the responses. I really appreciate the helpful nature of Scirra Construct community Ramesh2013-01-06 08:38:31
B
21
S
6
G
11
Posts: 30
Reputation: 5,396

Post » Mon Jan 07, 2013 4:03 pm

Running games from file:// is not supported because most browsers have such tight security limitations on files from disk that the games do not work at all. You must run the game from a web server for it to work. Preview on LAN might help with sharing games over a network from a C2 preview.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Jan 09, 2013 2:19 pm

Thanks @Ashley
B
21
S
6
G
11
Posts: 30
Reputation: 5,396

Post » Tue Jan 15, 2013 12:24 am

The same started ocurring to me. I'm running the game from my dropbox public folder. What should I do?
B
12
S
6
G
3
Posts: 100
Reputation: 3,836

Post » Tue Jan 15, 2013 3:17 pm

@pcfernandesjr - this is a closed bug report about a different issue. You might want to post somewhere else.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jan 15, 2013 3:52 pm

Sorry Ashley, I`ll create a topic for that.
B
12
S
6
G
3
Posts: 100
Reputation: 3,836

Post » Thu Jun 13, 2013 10:45 am

But I have the black screen also on-line:
1)I test the game with Chrome , Firefox and IE with play button [WORKS]
2)I export in HTML 5 and it works only with Firefox
3)I load the folder in my local server (XAMPP) and it works only with Firefox
4)I upload it on-line:
It works perfectly with Firefox
With other browsers it show black screen
Chrome sometimes show the game but it is very bug

my upload:
http://dakation.altervista.org/GW2/GW2/
B
8
S
1
Posts: 5
Reputation: 252

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest