v0.3.3

Core Concepts

Last updated


The ordered steps one Fetch call runs, from URL validation to the returned Result, with a link to the page that explains each step.

The fetch pipeline


#StepWhat happensDetails
1ValidateOption defaults are filled in; the URL must have a scheme and a dotted hostnameOption Fields
2RouteHeadless or headed is chosen from Option.Headless, Option.Visible, the session domain list and GUI availabilityFetch Routing
3Get a browserA cached instance keyed by (headless, userAgent), or a throwaway one with cookies when SameSession is setBrowser Cache, Cookie Sessions
4Acquire a slotThe page waits on the global concurrency semaphoreBrowser Cache
5Open the pageA blank tab gets the viewport and the stealth script, then navigates and waits for loadAnti-Detection
6Check the URLA 404 or 403 path segment or query value in the post-redirect URL ends the call with *ErrorTroubleshooting
7Short-circuit dataJSON and XML documents are returned as raw text with ContentType setOutput Formats
8SettleDOM stability wait, then SettleJSPage Loading
9ConsentUp to two passes of consent banner dismissalConsent Banners
10ScrollUp to ScrollCount passes, one snapshot per passPage Loading
11ConvertSnapshots become HTML, Markdown or a JSON treeOutput Formats

Context and timeout


The ctx passed to Fetch reaches every wait in the pipeline: the semaphore, settling, consent evaluation and scroll delays. A timeout above 0 wraps it in a child context for each attempt's page load, so a headed retry gets a fresh timeout of its own. SameSession cookie extraction and browser launch run before that child context exists and are bounded only by ctx. Settle and consent steps additionally cap each wait at IdleWait.

What one call does not do


  • It does not keep the tab open: every call creates a page and closes it before returning
  • It does not click, type or run custom scripts beyond StealthJS and SettleJS; the interactive tab API was removed in v0.3.2, see Removed API
中文