Files
Ant-Browser/backend/app_instance_status.go
T
ant-black 70132417ad publish: 1.2.0 snapshot (f3d7ec5)
channel: master

version: 1.2.0

source-ref: D:\code\open_source\ant-chrome master

source-commit: f3d7ec5

merged-public-base: 3d264eb
2026-05-05 18:08:10 +08:00

31 lines
831 B
Go

package backend
import "fmt"
func (a *App) BrowserInstanceStatus(profileId string) (*BrowserProfile, error) {
a.browserMgr.Mutex.Lock()
defer a.browserMgr.Mutex.Unlock()
profile, exists := a.browserMgr.Profiles[profileId]
if !exists {
return nil, fmt.Errorf("profile not found")
}
return profile, nil
}
func (a *App) BrowserInstanceOpenUrl(profileId string, targetUrl string) bool {
a.browserMgr.Mutex.Lock()
profile, exists := a.browserMgr.Profiles[profileId]
a.browserMgr.Mutex.Unlock()
if !exists || !profile.Running {
return false
}
return true
}
func (a *App) BrowserInstanceGetTabs(profileId string) []BrowserTab {
return []BrowserTab{
{TabId: "tab-1", Title: "新标签页", Url: "about:blank", Active: true},
{TabId: "tab-2", Title: "示例站点", Url: "https://example.com", Active: false},
}
}