`set_title` function
Currently, upon a window start the window title is the localhost path until the windows is full loaded. Then the windows html <title> is used.
Similar to the webui_set_icon function a webui_set_title function could be used to achive setting a consistent window title for a webui application.
If we add webui_set_title then it will behave like this:
- Web Browser
- Not connected
localhostuntil page is loaded, then<title>
- Connected
- Running JS to change title
- Not connected
- WebView
- Not connected
webui_set_titleuntil page is loaded, then<title>
- Connected
- Running JS to change title
- Not connected
If you don't see any issue in this, then let's add it.
Since WebUI is about making GUI apps, I think it can be a good think to set a consistent title (/ allow more control over the title) from the backend via an API function that is provided by WebUI.
I think there might be some options/workarounds to fully prevent the localhost, this would then make a webui app feel even more like a native gui app. I didn't made any tests yet though.
I tried set empty window title with:
<html><head><title></title></head>...
and
document.title = '';
None of the above code works. Window title remains "localhost:xxxx" But a 'non-empty' string works.
I guess the solution is easy as using <title> </title> and document.title = ' '; (Blank space)