Files
egutierrez 47fac22230 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

43 lines
1.6 KiB
Markdown

---
name: cdp_new_tab
kind: function
lang: go
domain: browser
version: 0.1.0
purity: impure
signature: "func CdpNewTab(host string, port int, startURL string) (CdpTab, error)"
description: "Abre una pestaña nueva via /json/new. Si startURL es vacio Chrome abre about:blank. Retorna el CdpTab recien creado con su id, webSocketDebuggerUrl, etc. Compatible con Chrome 126+ (PUT) y anteriores (fallback GET)."
tags: [browser, cdp, tabs, spawn, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [encoding/json, fmt, net/http, net/url]
example: |
tab, err := browser.CdpNewTab("localhost", 9222, "https://example.com")
if err == nil {
fmt.Println("nueva tab id=", tab.ID)
}
tested: true
tests: ["TestCdpNewTab_emptyURLOk"]
test_file_path: "functions/browser/cdp_list_tabs_test.go"
file_path: "functions/browser/cdp_list_tabs.go"
notes: |
- Definida en mismo archivo que CdpListTabs — comparten estructura.
- Desde Chrome 126 el endpoint requiere PUT. Mantenemos fallback a GET por compatibilidad.
- URL se codifica como query string raw (no clave=valor — formato historico de Chrome).
documentation: |
Util para abrir tabs de scraping bajo control programatico sin pasar por
WebSocket. Combina con CdpListTabs para enumerar antes/despues, y
CdpCloseTab para limpiar al final.
params:
- name: host
desc: "Host CDP (vacio = localhost)."
- name: port
desc: "Puerto remote-debugging."
- name: startURL
desc: "URL inicial. Vacio = about:blank."
output: "CdpTab del target recien creado (id, websocket url, ...). Error si HTTP falla."
---