cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.21k stars 7.06k forks source link

3.9 and 3.10 do not work on iOS Safari #15155

Open MatthewPringle opened 8 years ago

MatthewPringle commented 8 years ago

3.9 and 3.10 do not work in iOS Safari.

You can see this bug in action by downloading the html5 version ( lite or full ) and viewing the HelloWorld.html page in Safari.

The issue is that Safari won't append styles to the body. This causes a crash and the app stops running.

line 878 of the uncompressed, full version of cocos2d-js-v3.10.js

878 document.body.appendChild(fontStyle);

Change to

878 document.head.appendChild(fontStyle);

slackmoehrle commented 8 years ago

@pandamicro can you take a look at this? I talked with Matthew yesterday on the forums and it seems like this needs attention.

dyegos commented 8 years ago

Not only on Safari in iOS. All mobile web browsers.

Nanyx commented 8 years ago

Run into the same problem. We currently using 3.10

Do you know a quick way to fix it ? I don't think regression will work, we use cocos studio 3.10 for all the visual integration.

Thanks ;)

MatthewPringle commented 8 years ago

line 878 of the uncompressed, full version of cocos2d-js-v3.10.js

878 document.body.appendChild(fontStyle);

Change to

878 document.head.appendChild(fontStyle);