diff --git a/stampli_core.py b/stampli_core.py index df738f1..76d39a0 100644 --- a/stampli_core.py +++ b/stampli_core.py @@ -1,9 +1,17 @@ """Shared logic for Stampli bulk editor — used by both CLI scripts and the GUI.""" import json +import os import time from datetime import datetime, timedelta from pathlib import Path + +# Use system-wide Playwright browser cache so the bundled app doesn't +# look for browsers inside its own .app bundle. +_pw_cache = Path.home() / "Library" / "Caches" / "ms-playwright" +if _pw_cache.is_dir(): + os.environ.setdefault("PLAYWRIGHT_BROWSERS_PATH", str(_pw_cache)) + from playwright.sync_api import sync_playwright PROJECT_DIR = Path(__file__).parent