Exported as HTML5 Website - Black Screen on Chrome

0 favourites
From the Asset Store
This is a single chapter about "Decision Science" strategy games from the "Construct Starter Kit Collection" workshop.
  • 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 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.

    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.

    dl.dropbox.com/u/105699697/8-direction.zip

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

  • "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.

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

    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.

    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.

    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.

  • "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.

    Thanks thehen

    Sorry I missed the following forum topic in the "How do I....?" section.

    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!

    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.

    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

    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.

    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 <img src="smileys/smiley20.gif" border="0" align="middle">

  • 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.

  • Thanks Ashley

  • The same started ocurring to me. I'm running the game from my dropbox public folder. What should I do?

  • pcfernandesjr - this is a closed bug report about a different issue. You might want to post somewhere else.

  • Sorry Ashley, I`ll create a topic for that.

  • 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:

    dakation.altervista.org/GW2/GW2

  • DPDmancul - your example appears to work fine in Chrome and IE10 for me.

  • maybe because you have disabled the security guards from your browser?

    Disabling them does to me also trying with the play button does not need to disable them, why?

  • Ok now it works perfectly: I disabled VideoSaver extension that it was automaticly insatlled.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello ! I am a new user to constuct 2, may I ask what are the steps to export it as HTML 5 ?

  • My does not work at chrome too! Why is that happening ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)