Some checks failed
Security Scan / security (push) Failing after 24s
New stub files: - browser_manager.go, browser_window.go (95 methods, full Window interface) - clipboard.go, context_menu.go, dialog.go (33 dialog methods) - environment.go, events.go, keybinding.go - menuitem.go, screen.go, services.go - webview_window_options.go (574 lines, all platform types) - window.go (Window interface ~50 methods) - window_manager_expanded.go (Get, GetByID) - application_options.go (Options, platform options, iOS/Android) App struct expanded with all manager fields. WebviewWindow and BrowserWindow both satisfy Window interface. GetAll() returns []Window (was []any). All stubs compile clean: GOWORK=off go build ./... Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
842 B
Go
36 lines
842 B
Go
package application
|
|
|
|
import "sync"
|
|
|
|
// BrowserManager manages browser-related operations in-memory.
|
|
//
|
|
// manager := &BrowserManager{}
|
|
// manager.OpenURL("https://example.com")
|
|
// last := manager.LastURL // "https://example.com"
|
|
type BrowserManager struct {
|
|
mu sync.RWMutex
|
|
LastURL string
|
|
LastFile string
|
|
}
|
|
|
|
// OpenURL stores the URL as the last opened URL.
|
|
//
|
|
// manager.OpenURL("https://lthn.io")
|
|
// _ = manager.LastURL // "https://lthn.io"
|
|
func (bm *BrowserManager) OpenURL(url string) error {
|
|
bm.mu.Lock()
|
|
bm.LastURL = url
|
|
bm.mu.Unlock()
|
|
return nil
|
|
}
|
|
|
|
// OpenFile stores the path as the last opened file.
|
|
//
|
|
// manager.OpenFile("/home/user/report.pdf")
|
|
// _ = manager.LastFile // "/home/user/report.pdf"
|
|
func (bm *BrowserManager) OpenFile(path string) error {
|
|
bm.mu.Lock()
|
|
bm.LastFile = path
|
|
bm.mu.Unlock()
|
|
return nil
|
|
}
|