feat: 9 new banner checks (12-20), total 20 compliance checks

Check 12: Click count — reject requires more clicks than accept (CNIL 150M EUR)
Check 13: Color contrast — reject button invisible (same bg as banner)
Check 14: Google Consent Mode — analytics_storage 'granted' as default
Check 15: Pre-consent cookies — tracking cookies set before any interaction
Check 16: Registration coupling — login button = consent (Art. 7(4) DSGVO)
Check 17: Language mismatch — banner vs page language (all 26 EU languages)
Check 18: Consent cookie expiry — >13 months violates CNIL guidelines
Check 19: Nudging — reject button below fold / requires scrolling
Check 20: Emotional language (Stirring) — "volle Funktionalitaet" etc.

Language detection covers: BG, CS, DA, DE, EL, EN, ES, ET, FI, FR, GA,
HR, HU, IS, IT, LT, LV, MT, NL, NO, PL, PT, RO, SK, SL, SV

New file: banner_advanced_checks.py (396 LOC)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-04 08:38:46 +02:00
parent 5d138f265b
commit b997b4a475
2 changed files with 404 additions and 0 deletions
@@ -18,6 +18,7 @@ Banner text legal checks — extracted from consent_scanner.py.
import logging
from services.script_analyzer import Violation
from services.banner_advanced_checks import run_advanced_checks
logger = logging.getLogger(__name__)
@@ -393,6 +394,13 @@ async def check_banner_text(page) -> dict:
except Exception:
pass
# ── Checks 12-20: Advanced checks ──────────────────────
try:
advanced = await run_advanced_checks(page, banner_text)
violations.extend(advanced)
except Exception as e:
logger.warning("Advanced banner checks failed: %s", e)
except Exception as e:
logger.warning("Banner text check failed: %s", e)