webui icon indicating copy to clipboard operation
webui copied to clipboard

`set_title` function

Open ttytm opened this issue 1 year ago • 3 comments

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.

ttytm avatar May 31 '24 19:05 ttytm

If we add webui_set_title then it will behave like this:

  • Web Browser
    • Not connected
      • localhost until page is loaded, then <title>
    • Connected
      • Running JS to change title
  • WebView
    • Not connected
      • webui_set_title until page is loaded, then <title>
    • Connected
      • Running JS to change title

If you don't see any issue in this, then let's add it.

hassandraga avatar May 31 '24 23:05 hassandraga

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.

ttytm avatar May 31 '24 23:05 ttytm

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.

aztack avatar Sep 12 '24 08:09 aztack

I guess the solution is easy as using <title> </title> and document.title = ' '; (Blank space)

AlbertShown avatar Mar 07 '25 22:03 AlbertShown