Facebook - Workflow geht aber Popup nicht da mit Browser nicht anbtouchen

Dieser Commit ist enthalten in:
Claude Project Manager
2025-09-14 20:59:12 +02:00
Ursprung d0920d4078
Commit 4903dee3bc
10 geänderte Dateien mit 633 neuen und 182 gelöschten Zeilen

Datei anzeigen

@ -13,7 +13,6 @@ from browser.playwright_manager import PlaywrightManager
from utils.proxy_rotator import ProxyRotator
from utils.email_handler import EmailHandler
from utils.text_similarity import TextSimilarity, fuzzy_find_element, click_fuzzy_button
from domain.value_objects.browser_protection_style import BrowserProtectionStyle, ProtectionLevel
# Konfiguriere Logger
logger = logging.getLogger("base_automation")
@ -167,12 +166,6 @@ class BaseAutomation(ABC):
self.browser.start()
logger.info("Browser erfolgreich initialisiert")
# Browser-Schutz anwenden wenn nicht headless
if not self.headless:
self._emit_customer_log("🛡️ Sicherheitseinstellungen werden konfiguriert...")
# TEMPORÄR DEAKTIVIERT zum Testen
# self._apply_browser_protection()
logger.info("Browser-Schutz wurde temporär deaktiviert")
self._emit_customer_log("✅ Verbindung erfolgreich hergestellt")
return True
@ -532,51 +525,6 @@ class BaseAutomation(ABC):
return code
def _apply_browser_protection(self):
"""Wendet Browser-Schutz an, um versehentliche Interaktionen zu verhindern."""
try:
# Lade Schutz-Einstellungen aus stealth_config.json
import json
from pathlib import Path
protection_config = None
try:
config_file = Path(__file__).parent.parent / "config" / "stealth_config.json"
if config_file.exists():
with open(config_file, 'r', encoding='utf-8') as f:
stealth_config = json.load(f)
protection_config = stealth_config.get("browser_protection", {})
except Exception as e:
logger.warning(f"Konnte Browser-Schutz-Konfiguration nicht laden: {e}")
# Nutze Konfiguration oder Standardwerte
if protection_config and protection_config.get("enabled", True):
level_mapping = {
"none": ProtectionLevel.NONE,
"light": ProtectionLevel.LIGHT,
"medium": ProtectionLevel.MEDIUM,
"strong": ProtectionLevel.STRONG
}
protection_style = BrowserProtectionStyle(
level=level_mapping.get(protection_config.get("level", "medium"), ProtectionLevel.MEDIUM),
show_border=protection_config.get("show_border", True),
show_badge=protection_config.get("show_badge", True),
blur_effect=protection_config.get("blur_effect", False),
opacity=protection_config.get("opacity", 0.1),
badge_text=protection_config.get("badge_text", "🔒 Account wird erstellt - Bitte nicht eingreifen"),
badge_position=protection_config.get("badge_position", "top-right"),
border_color=protection_config.get("border_color", "rgba(255, 0, 0, 0.5)")
)
# Wende Schutz an
if hasattr(self.browser, 'apply_protection'):
self.browser.apply_protection(protection_style)
logger.info("Browser-Schutz aktiviert")
except Exception as e:
# Browser-Schutz ist optional, Fehler nicht kritisch
logger.warning(f"Browser-Schutz konnte nicht aktiviert werden: {str(e)}")
def _is_text_similar(self, text1: str, text2: str, threshold: float = None) -> bool:
"""