5b7f7d9f31
A packed binary opened the system browser, so it felt like a tab, not an app. Build with -tags webview (cgo) and the viewer instead opens the site in its own window backed by the OS WebView: WKWebView on macOS, WebView2 on Windows, WebKitGTK on Linux. The viewer package picks an implementation at build time. The default file opens the browser and keeps the build pure Go, so CGO_ENABLED=0 and the release pipeline are untouched. The webview file links the platform WebView and runs its event loop on the main goroutine, which main now pins with LockOSThread before anything else, since macOS requires UI on the initial thread. Both kage open and the embedded viewer serve over HTTP in a goroutine and hand the URL to the viewer, then tear the server down when the window closes or Ctrl-C cancels. The window title comes from the archive's M/Title. OpenInBrowser moves out of pack into the viewer package, its only caller.
47 lines
1.9 KiB
Modula-2
47 lines
1.9 KiB
Modula-2
module github.com/tamnd/kage
|
|
|
|
go 1.26.4
|
|
|
|
require (
|
|
charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410
|
|
github.com/charmbracelet/fang v1.0.0
|
|
github.com/go-rod/rod v0.116.2
|
|
github.com/go-rod/stealth v0.4.9
|
|
github.com/klauspost/compress v1.18.6
|
|
github.com/spf13/cobra v1.10.2
|
|
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6
|
|
golang.org/x/net v0.56.0
|
|
)
|
|
|
|
require (
|
|
github.com/charmbracelet/colorprofile v0.3.3 // indirect
|
|
github.com/charmbracelet/ultraviolet v0.0.0-20251106190538-99ea45596692 // indirect
|
|
github.com/charmbracelet/x/ansi v0.11.0 // indirect
|
|
github.com/charmbracelet/x/exp/charmtone v0.0.0-20250603201427-c31516f43444 // indirect
|
|
github.com/charmbracelet/x/term v0.2.2 // indirect
|
|
github.com/charmbracelet/x/termios v0.1.1 // indirect
|
|
github.com/charmbracelet/x/windows v0.2.2 // indirect
|
|
github.com/clipperhouse/displaywidth v0.4.1 // indirect
|
|
github.com/clipperhouse/stringish v0.1.1 // indirect
|
|
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
|
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
|
|
github.com/mattn/go-runewidth v0.0.19 // indirect
|
|
github.com/muesli/cancelreader v0.2.2 // indirect
|
|
github.com/muesli/mango v0.1.0 // indirect
|
|
github.com/muesli/mango-cobra v1.2.0 // indirect
|
|
github.com/muesli/mango-pflag v0.1.0 // indirect
|
|
github.com/muesli/roff v0.1.0 // indirect
|
|
github.com/rivo/uniseg v0.4.7 // indirect
|
|
github.com/spf13/pflag v1.0.9 // indirect
|
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
|
github.com/ysmood/fetchup v0.2.3 // indirect
|
|
github.com/ysmood/goob v0.4.0 // indirect
|
|
github.com/ysmood/got v0.40.0 // indirect
|
|
github.com/ysmood/gson v0.7.3 // indirect
|
|
github.com/ysmood/leakless v0.9.0 // indirect
|
|
golang.org/x/sync v0.21.0 // indirect
|
|
golang.org/x/sys v0.46.0 // indirect
|
|
golang.org/x/text v0.38.0 // indirect
|
|
)
|