I would like to use the fullscreen browser to display a static web page containing some scripts.
I tried to upload the html file to my assets, but the filetype is not allowed.
Do I have to spin up a web server just for hosting a 7KB html file or is there another way?
Correct. That’s not directly possible as there’s no such thing as an HTML asset at the moment. But there is another way: You can create a custom package. Give it a minimal node.json (as there’s nothing to configure), a minimal package.json and package.png and an empty node.lua. Then add your HTML files along those files. You can use git to push those files into that package.
Add that package as a child node of the browser package using the “Add package” button on left side in your browser setup’s configuration. Give a node name like content.
You can then point the browser to http://localhost:8888/content/index.html and you should see the index.html you added to your package. Updating the HTML content is then as simple as modifying the files and then commit and push them and they will be immediately pushed to all devices using that package and you should see the changes on the next browser page refresh.
I just tested this and it works as expected with a minor additional option needed in the package.json file. Here’s the full steps. Create a new empty package directory and add these files:
node.json
{
"name": "Web Stuff",
"options": []
}
package.json
{
"name": "Web assets",
"author": Your name <email>",
"desc": "Offline web assets",
"nesting": {
"parents": "any",
"childs": []
}
}
package.png
Any 64x64 png
node.lua
An empty file
Web assets
I opened up a webpage in Chrome, used the “Save as…” and “Website, Complete” option in the save dialog to save a complete website. Then copied both the generated html and its directory into the package’s directory.
When successful, your package is ready. Go to a cef browser package based setup, on the left, click in Add package…, put “web” as the directory name and click on the Add button next to “Web assets” (this is the name given in package.json above).