-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebview_stub.go
More file actions
46 lines (37 loc) · 924 Bytes
/
webview_stub.go
File metadata and controls
46 lines (37 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//go:build !darwin && crossbuild
package main
import (
"log"
"sync"
)
var (
wvMu sync.Mutex
wvDashboardURL string
)
// initWebview stores the dashboard URL (browser-only fallback for cross-compiled builds).
func initWebview(dashURL string) {
wvMu.Lock()
defer wvMu.Unlock()
wvDashboardURL = dashURL
log.Printf("[webview] cross-build mode — browser fallback active")
}
// showDashboard opens the dashboard in the system browser.
func showDashboard(dashURL string) {
wvMu.Lock()
url := dashURL
if url == "" {
url = wvDashboardURL
}
wvMu.Unlock()
if url == "" {
return
}
log.Printf("[webview] opening browser: %s", url)
openBrowser(url)
}
// setWebviewTitle is a no-op in browser mode.
func setWebviewTitle() {}
// isWebviewActive always returns false in browser mode.
func isWebviewActive() bool { return false }
// destroyWebview is a no-op in browser mode.
func destroyWebview() {}