feat(browser): auto-commit con 44 cambios

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 12:49:54 +02:00
parent e2c073b8b7
commit 5b10b419a2
44 changed files with 2543 additions and 28 deletions
+13 -1
View File
@@ -1,6 +1,7 @@
package browser
import (
"encoding/json"
"fmt"
)
@@ -44,5 +45,16 @@ func CdpEvaluate(c *CDPConn, expression string) (string, error) {
return typ, nil
}
return fmt.Sprintf("%v", value), nil
// Strings se devuelven tal cual (sin comillas). Objetos y arrays JS, que Chrome
// deserializa a map/slice cuando returnByValue=true, se serializan a JSON real
// en vez de la repr de Go de fmt.Sprintf("%v") (que produciria "map[a:1]" en lugar
// de {"a":1}). Asi el caller puede parsear datos estructurados.
if s, ok := value.(string); ok {
return s, nil
}
b, err := json.Marshal(value)
if err != nil {
return fmt.Sprintf("%v", value), nil
}
return string(b), nil
}