HTML5 Game won't run in Firefox

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Ben_Saint, Nov 1, 2017.

Tags:
  1. Ben_Saint

    Ben_Saint Member

    Joined:
    Oct 20, 2017
    Posts:
    6
    So I recently completed a game for my website and uploaded it only to find that while it works perfectly in Chrome, it won't run in Firefox. This happens even if I set the target device to Firefox when building the game files. I thought at first that the iframe the game is placed in just wasn't showing, but it must be showing because you do see the loading bar when the page opens, but then when the game should start it's just a blank black screen. Anyone have any clue what the problem could be? I don't even know how to start fixing this issue.

    Here's a link to the page the game's currently on: http://saintcomix.com/c000.html

    Thanks for reading, let me know if you've got any ideas.
     
  2. Mike

    Mike Evil YoYo Games Employee Forum Staff Admin YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    Sounds like Firefox has changed something. Can you file a bug and include the project, and I'll take a look see what they've broken now :)

    EDIT: Actually... looks like Chrome and IE has a fix for this issue, but not FF. I'll add that in as well...
     
    Last edited: Nov 1, 2017
  3. Ben_Saint

    Ben_Saint Member

    Joined:
    Oct 20, 2017
    Posts:
    6
    Hi, thanks for the response, sorry though I'm new to these forums. Can you direct me to where to file the report and how to include the project with it?
     
  4. Mike

    Mike Evil YoYo Games Employee Forum Staff Admin YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    Don't worry, I managed to find the issue... not sure when the fix will make it out. It's the Audio (WebAudio) that FF has a problem with.
     
  5. Ben_Saint

    Ben_Saint Member

    Joined:
    Oct 20, 2017
    Posts:
    6
    Is there any kind of workaround for it? Like would changing the audio settings have any effect?
     
  6. Mike

    Mike Evil YoYo Games Employee Forum Staff Admin YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    There's a "hack" you could do to the final script. It's crashing due to .cloneNode() not working. Above this line it you'll find....

    if ((_cT == _Hg2) || (_cT == _dT)) {

    You can change it to this...

    if ((_cT == _Hg2) || (_cT == _dT) || (_cT==2) ) {

    And that should allow it to run. If you rebuild, you can search for .cloneNode( again and fit it up again.
     
  7. chmod777

    chmod777 Member

    Joined:
    Aug 26, 2016
    Posts:
    141
    I don't know what this cloneNode is supposed to do but I have faced a similar weird problem in a old project.
    Actually, the issue occurred when a sound has the same name than a JavaScript property!

    So, if you try to name a sound "toString", then launch the game with Microsoft Edge, I'm pretty sure you will get the same issue.
     
  8. True Valhalla

    True Valhalla Full-Time Developer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    261
    Is this only an issue with GMS 2? My 1.4 games are still working in the latest version of Firefox.
     
  9. Mike

    Mike Evil YoYo Games Employee Forum Staff Admin YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    Not sure.... Didn't look into it that far, just saw FF was crashing on it, and noticed there were checks around it for Chrome and IE.....
     
  10. chmod777

    chmod777 Member

    Joined:
    Aug 26, 2016
    Posts:
    141
    Same and it works fine in GMS2 as well (at least for common usages), it just crashed in the conditions I have described above.
     
  11. Ben_Saint

    Ben_Saint Member

    Joined:
    Oct 20, 2017
    Posts:
    6
    Wow Mike, you're a lifesaver. When i finally found the spot to insert the code you gave me, it worked like a charm. The game linked in the OP now seems to be working fine on both Chrome and Firefox. Thanks!
     
  12. Filipp_BSG

    Filipp_BSG Member

    Joined:
    Jun 21, 2016
    Posts:
    28
    Maybe some off-topic, but the last version of Firefox have a lot of issues when working with HTML5/canvas. Most HTML5 games have noticeable (up to 0.5 sec) tearings about every 10-15 seconds.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice