New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add warning when trying to load HTML5 build from local filesystem #7463
Add warning when trying to load HTML5 build from local filesystem #7463
Conversation
@@ -69,6 +69,11 @@ | |||
</head> | |||
|
|||
<body> | |||
<div id="running-from-file-warning" style="display: none; margin: 3em;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we exclude it for release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly. Or have it as an option in game.project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm maybe, but in this case user will never know we have something like this in index.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One concern I have with removing this warning in a release build is that a beginner might export a release build and try to double-click on index.html and end up in the same situation as we're trying to resolve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
If you bundle Defold HTML5 projects into a single HTML file it does work though! You can try it yourself with this tool https://github.com/aglitchman/defold-playable-ads I wish this was a feature of Defold when bundling HTML5 projects as a checkbox since there are many use cases for this beyond ads. Simply making sharable single file games or apps that do work when ran locally is useful too. |
So point is maybe don't force this warning always / add easy way to disable it. |
The warning is added to the default index.html. If you bundle your game into a single html file you won't be using the default index.html anyway. |
A common mistake for beginners is to double-click on index.html when attempting to test an HTML5 bundle. This will not work since the browser is unable to load the rest of the files required to run the Defold game. This change adds a warning message and instructions on how to test an HTML5 build locally:
Fixes #7447