From 9b933ea70cb03de03c5726a569cb81476f884aee Mon Sep 17 00:00:00 2001 From: ThePhaseless Date: Tue, 11 Aug 2026 11:23:31 +0200 Subject: [PATCH] chore: drop explanatory comments --- src/endpoints.py | 5 ----- src/utils.py | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/endpoints.py b/src/endpoints.py index a44f6a5..f32f5cf 100644 --- a/src/endpoints.py +++ b/src/endpoints.py @@ -153,11 +153,6 @@ async def read_item(request: LinkRequest, dep: BrowserDep) -> LinkResponse: else await dep.page.content() ) - # The User-Agent the target site actually saw, taken from the navigation - # request headers. page.evaluate falls through to eval() in the page's - # main world and fails whenever the page CSP disallows eval (e.g. the - # Firefox JSON viewer in #394, or uncatchable meta-tag CSP), so evaluate - # is only a fallback and its failure must not turn the request into a 500. user_agent = ( page_request.request.headers.get("user-agent") if page_request else None ) diff --git a/src/utils.py b/src/utils.py index 83f1470..abc4ff2 100644 --- a/src/utils.py +++ b/src/utils.py @@ -96,11 +96,6 @@ async def get_browser( proxy=proxy_config, humanize=True, locale=BROWSER_LOCALE or "auto", - # Firefox renders application/json documents in a built-in viewer whose - # own CSP (`script-src resource:`) blocks Playwright's eval-based - # evaluate(), crashing /v1 on JSON APIs (issue #394). Disabling the - # viewer renders JSON as plain text: evaluate works and consumers get - # the raw JSON instead of the viewer's HTML markup. extra_prefs={"devtools.jsonview.enabled": False}, ) as browser_raw: # InvisiblePlaywright yields a Browser instance