From 9f60eeaaf2c5a4a020d5764ce2e7ce7f734d2ba5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:50:36 +0000 Subject: [PATCH] =?UTF-8?q?fix(ai):=20frontend=20console=20error=20?= =?UTF-8?q?=E2=80=94=20ignore=20.torrent=20urls=20in=20probeUrl=20(agent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/ui/urlHealthController.js | 4 ++++ scripts/agent/debug_frontend.py | 26 ++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) 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()