From 74ff9fdcb8b49a021b63ac2e6b0191e29754d0f3 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 6 Nov 2026 03:17:13 +0000 Subject: castle-search: read Google results again by resolving its /goto links Google now wraps every result as google.com/goto?url=. The self-host filter discarded all of them, so every Google search failed with 'nothing could be parsed'. Accept /goto, resolve it node-side from the 302 Location, and when Google answers its 'Verifying your request' interstitial instead, keep the wrapped link and put the displayed breadcrumb in the snippet. --- castle-search/src/search.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'castle-search/src/search.ts') diff --git a/castle-search/src/search.ts b/castle-search/src/search.ts index 1306443..1c84392 100644 --- a/castle-search/src/search.ts +++ b/castle-search/src/search.ts @@ -8,6 +8,7 @@ * first search and closed by an idempotent `session_shutdown`. */ +import { resolveGoogleLinks } from "./resolve.ts"; import { BrowserConnection, PageSession, raceAbort } from "./cdp.ts"; import { type CdpTarget, @@ -319,7 +320,7 @@ export const search = async ( } return { - results: probe.results.slice(0, request.numResults), + results: await resolveGoogleLinks(probe.results.slice(0, request.numResults), signal), searchUrl, finalUrl: probe.url || searchUrl, endpoint, -- cgit v1.2.3