Skip to content

chore(web-scraper): cut page function context - #404

Merged
nikitachapovskii-dev merged 1 commit into
masterfrom
chore/web-scraper-page-context
Nov 20, 2026
Merged

nikitachapovskii-dev merged 1 commit into
masterfrom
chore/web-scraper-page-context

Conversation

@nikitachapovskii-dev

@nikitachapovskii-dev nikitachapovskii-dev commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

For more context, see https://github.com/apify/apify-core/issues/33078.

This trims what Web Scraper passes to the page function:

  • context.env: token, proxyPassword, inputSecretsPrivateKeyFile, inputSecretsPrivateKeyPassphrase, containerUrl, and webServerUrl are now null.
  • context.input: initialCookies, proxyConfiguration, preNavigationHooks, and postNavigationHooks are no longer included.
  • proxyInfo is no longer sent to the page. The page function never had access to it.

Cookies, proxies, and hooks work as before.

What page functions can no longer do

  • Read the run input through context.getValue('INPUT'), for example when a wrapper Actor metamorphs into Web Scraper and its page function reads the wrapper's original input
  • Change the run input with context.setValue('INPUT', …)
  • Read crawler state such as request statistics (SDK_CRAWLER_STATISTICS_0) or the session pool, for example to report progress
  • Store their own records under names like input, input.json, sdk_cache, or crawlee_data, including in a named key-value store

Closes https://github.com/apify/apify-core/issues/33078

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The constructor now omits initialCookies, proxyConfiguration, and navigation hooks from serialized input. It sets selected environment values to null before passing the environment to browser code. The request handler no longer includes proxyInfo in pageFunctionArguments; request and response data remain.

Merge Risk: Minimal · up to c18ec

This change keeps secrets and proxy details out of the page function context, while cookies, proxies and hooks continue to be applied by Node. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title "chore(web-scraper): cut page function context" names the main change: trimming the context passed to the page function. The raw summary shows edits in crawler_setup.ts that omit initialCook…
Description check Passed The description names the specific changed fields in context.env, context.input, and proxyInfo, and it explains the impact on page functions. It matches the crawler_setup.ts changes in the summary, so…
Full details: Title check

Explanation

The title "chore(web-scraper): cut page function context" names the main change: trimming the context passed to the page function. The raw summary shows edits in crawler_setup.ts that omit initialCookies, proxyConfiguration, navigation hooks, and proxyInfo, and null out secret and URL env fields. The title is specific, short, and matches the objectives. It omits the detail that cookies, proxies, and hooks still work through Node, which is acceptable.

Full details: Description check

Explanation

The description names the specific changed fields in context.env, context.input, and proxyInfo, and it explains the impact on page functions. It matches the crawler_setup.ts changes in the summary, so it is related to the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 6eee59c6-a482-4b1a-a94d-7526a74ce078
Commits

Reviewing files that changed from the base of the PR and between c8b3de1 and c18ec91.

Files selected for processing: 1

  • packages/actor-scraper/web-scraper/src/internals/crawler_setup.ts

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@nikitachapovskii-dev nikitachapovskii-dev self-assigned this Nov 20, 2026
@nikitachapovskii-dev nikitachapovskii-dev changed the title chore(web-scraper): keep credentials out of the page function context chore(web-scraper): cut page function context Nov 20, 2026
@nikitachapovskii-dev
nikitachapovskii-dev merged commit b39eddb into master Nov 20, 2026
8 checks passed
@nikitachapovskii-dev
nikitachapovskii-dev deleted the chore/web-scraper-page-context branch November 20, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants