Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

feat: expose profile filesystem path in API and dashboard details

Mario805166570ea0
diff --git a/internal/bridge/api.go b/internal/bridge/api.go
index 8beb185d..89213920 100644
--- a/internal/bridge/api.go
+++ b/internal/bridge/api.go
@@ -71,6 +71,7 @@ type OrchestratorService interface {
type ProfileInfo struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
+ Path string `json:"path,omitempty"` // File system path to profile directory
Created time.Time `json:"created"`
LastUsed time.Time `json:"lastUsed"`
DiskUsage int64 `json:"diskUsage"`
diff --git a/internal/bridge/tab_manager.go b/internal/bridge/tab_manager.go
index 7582ea2d..a5ef71da 100644
--- a/internal/bridge/tab_manager.go
+++ b/internal/bridge/tab_manager.go
@@ -69,7 +69,14 @@ func (tm *TabManager) TabContext(tabID string) (context.Context, string, error)
if entry, ok := tm.tabs[tabID]; ok && entry.Ctx != nil {
tm.mu.RUnlock()
tm.markAccessed(tabID)
- return entry.Ctx, tabID, nil
+ // When this entry is a hash alias, return the canonical raw CDP ID so that
+ // operations like ref-cache lookups are consistent regardless of which ID
+ // form was used to call TabContext.
+ resolvedID := tabID
+ if entry.CDPID != "" {
+ resolvedID = entry.CDPID
+ }
+ return entry.Ctx, resolvedID, nil
}
tm.mu.RUnlock()
diff --git a/internal/handlers/navigation.go b/internal/handlers/navigation.go
index 94f52130..fab7d4be 100644
--- a/internal/handlers/navigation.go
+++ b/internal/handlers/navigation.go
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"net/http"
+ "net/url"
"strings"
"time"
@@ -121,6 +122,10 @@ func (h *Handlers) HandleNavigate(w http.ResponseWriter, r *http.Request) {
}
if req.NewTab {
+ if parsed, err := url.Parse(req.URL); err != nil || parsed.Scheme == "" || (!strings.HasPrefix(parsed.Scheme, "http") && !strings.HasPrefix(parsed.Scheme, "chrome") && parsed.Scheme != "file" && parsed.Scheme != "data") {
+ web.Error(w, 400, fmt.Errorf("invalid URL: must start with http://, https://, or other valid scheme"))
+ return
+ }
newTargetID, newCtx, newCtxCancel, err := h.Bridge.CreateTab(req.URL)
if err != nil {
web.Error(w, 500, fmt.Errorf("new tab: %w", err))
diff --git a/internal/profiles/profiles.go b/internal/profiles/profiles.go
index badeb079..20279ca3 100644
--- a/internal/profiles/profiles.go
+++ b/internal/profiles/profiles.go
@@ -112,6 +112,7 @@ func (pm *ProfileManager) List() ([]bridge.ProfileInfo, error) {
profiles = append(profiles, bridge.ProfileInfo{
ID: info.ID,
Name: info.Name,
+ Path: info.Path,
Created: info.CreatedAt,
Temporary: isTemporary,
DiskUsage: int64(info.SizeMB * 1024 * 1024),