Files
fn_registry/functions/browser/cdp_navigate.go
T
egutierrez bf1efb2099 feat: externalize apps/analysis to Gitea repos, add analysis table
- Migration 007: repo_url on apps table + analysis table with FTS5
- Analysis struct, parser, CRUD, validation, hash computation
- Selective purge: remote-only apps/analysis preserved across fn index
- CLI: fn app list/clone/pull, fn analysis list/clone/pull
- search/show/list now include analysis results
- Apps removed from git tracking (content lives in Gitea repos)
- .gitkeep for apps/ and analysis/ dirs
- Bash functions: jupyter analysis pipeline, shell utilities
- Browser domain: CDP functions moved from infra to browser

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 04:23:51 +02:00

31 lines
762 B
Go

package browser
import (
"fmt"
)
// CdpNavigate navega a la URL indicada usando Page.navigate.
// Espera a que la carga este confirmada via Page.loadEventFired antes de retornar.
// El timeout de la navegacion es gestionado por Chrome internamente.
func CdpNavigate(c *CDPConn, targetURL string) error {
if c == nil {
return fmt.Errorf("cdp navigate: conexion nula")
}
params := map[string]any{
"url": targetURL,
}
result, err := c.sendCDP("Page.navigate", params)
if err != nil {
return fmt.Errorf("cdp navigate: %w", err)
}
// Verificar que no hubo error de navegacion
if errText, ok := result["errorText"].(string); ok && errText != "" {
return fmt.Errorf("cdp navigate: error navegando a %q: %s", targetURL, errText)
}
return nil
}