feat: gestión de extensiones de Chrome
Implementa sistema para cargar y gestionar extensiones. Incluye: - Cargar extensiones desde carpetas o archivos .crx - Config.Extensions para especificar al lanzar - buildExtensionFlags() integrado en Launch() - Extensiones predefinidas (uBlock, Tampermonkey) - ListLocalExtensions() y GetExtensionPath() Flags utilizadas: --load-extension, --disable-extensions-except Archivo: pkg/browser/extensions.go, pkg/browser/browser.go
This commit is contained in:
@@ -44,6 +44,12 @@ type Config struct {
|
||||
// StealthFlags son las configuraciones stealth
|
||||
StealthFlags *stealth.StealthFlags
|
||||
|
||||
// Extensions son las extensiones a cargar
|
||||
Extensions []*ExtensionConfig
|
||||
|
||||
// DisableOtherExts deshabilita todas las extensiones excepto las especificadas
|
||||
DisableOtherExts bool
|
||||
|
||||
// Timeout para iniciar el navegador
|
||||
StartTimeout time.Duration
|
||||
|
||||
@@ -92,6 +98,10 @@ func Launch(ctx context.Context, config *Config) (*Browser, error) {
|
||||
// Construir flags
|
||||
flags := config.StealthFlags.Build()
|
||||
|
||||
// Agregar flags de extensiones
|
||||
extFlags := config.buildExtensionFlags()
|
||||
flags = append(flags, extFlags...)
|
||||
|
||||
// Crear comando
|
||||
cmd := exec.CommandContext(ctx, config.ExecutablePath, flags...)
|
||||
cmd.Env = append(os.Environ(), config.Env...)
|
||||
|
||||
Reference in New Issue
Block a user