Files
2026-05-09 18:11:21 +02:00

34 lines
1.0 KiB
C++

#pragma once
#include <cstdint>
#include <string>
namespace navegator {
struct LaunchOpts {
std::string chrome_path; // por defecto auto-detect
int port = 19222; // remote-debugging-port
std::string user_data_dir; // ruta Windows (C:\...) — obligatorio para aislar
bool headless = false;
std::string start_url; // URL inicial; vacio = about:blank
};
struct LaunchResult {
bool ok = false;
uint32_t pid = 0;
std::string error; // descripcion humana si ok=false
};
// Lanza chrome.exe con los flags de remote debugging que YA descubrimos
// que funcionan en Chrome 147 (ver projects/navegator/notes/2026-05-09-...):
// --remote-debugging-port=<port>
// --remote-allow-origins=* [obligatorio Chrome 111+]
// --user-data-dir=<dir>
// --no-first-run --no-default-browser-check
// + flags si headless.
//
// NO usa --remote-debugging-address=0.0.0.0 (rompe bind en Chrome 147).
LaunchResult launch_chrome(const LaunchOpts& opts);
} // namespace navegator