diff --git a/js/ui/urlHealthController.js b/js/ui/urlHealthController.js index 4591f095..eea594c0 100644 --- a/js/ui/urlHealthController.js +++ b/js/ui/urlHealthController.js @@ -323,6 +323,10 @@ export default class UrlHealthController { return { outcome: "invalid" }; } + if (trimmed.toLowerCase().endsWith(".torrent")) { + return { outcome: "invalid" }; + } + const confirmPlayable = options?.confirmPlayable === true; const defaultTimeout = this.constants.URL_PROBE_TIMEOUT_MS || 5000; const urlHealthConstants = this.constants.urlHealthConstants || {}; diff --git a/scripts/agent/debug_frontend.py b/scripts/agent/debug_frontend.py index 8142f20b..d54a056a 100644 --- a/scripts/agent/debug_frontend.py +++ b/scripts/agent/debug_frontend.py @@ -1,33 +1,31 @@ +from playwright.sync_api import sync_playwright import sys import time -from playwright.sync_api import sync_playwright def run(): with sync_playwright() as p: - # Launch browser (headless by default) browser = p.chromium.launch() page = browser.new_page() - # Capture console messages + print("--- Debugging Frontend ---") + + # Listen for console messages page.on("console", lambda msg: print(f"console:{msg.type}: {msg.text}")) - # Capture uncaught exceptions + # Listen for uncaught exceptions page.on("pageerror", lambda exc: print(f"pageerror: {exc}")) - # Capture failed requests - page.on("requestfailed", lambda request: print(f"requestfailed: {request.url} {request.failure}")) + # Listen for failed requests + page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} {req.failure}")) try: - print("Navigating to http://localhost:8000...") page.goto("http://localhost:8000") - - # Wait for some time to catch initialization errors - time.sleep(5) - + # Wait for network idle or a specific time to allow scripts to execute + page.wait_for_timeout(5000) except Exception as e: - print(f"Script error: {e}") - finally: - browser.close() + print(f"Navigation failed: {e}") + + browser.close() if __name__ == "__main__": run()