refactor(display): use chrome devtools protocol (#38)

This commit is contained in:
2026-01-30 15:26:57 +01:00
committed by GitHub
parent cbbf50e5a4
commit 71f152ef2a
24 changed files with 570 additions and 504 deletions
+7 -7
View File
@@ -4,9 +4,9 @@ import (
"log/slog"
"os"
"plg-mudics/display/browser"
"plg-mudics/display/pkg"
"plg-mudics/display/web"
"plg-mudics/shared"
)
//go:generate go tool templ generate
@@ -25,10 +25,10 @@ func main() {
// the order is important, the open browser command exitsts as soon as the winodw is closed
// and since its the last action in the main go func all other goroutines (e.g. the webserver) are killed
go web.StartWebServer(shared.Version, port)
err = shared.OpenBrowserWindow("http://localhost:"+port, true, "display")
if err != nil {
slog.Error("Failed to open browser window", "error", err)
os.Exit(1)
}
go web.StartWebServer(port)
browser.Browser.Init()
pkg.OpenStartScreen()
defer browser.Browser.Cancel()
<-browser.Browser.Ctx.Done()
}