mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-09-24 14:20:08 +01:00
chore: drop explanatory comments
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user