Skip to content

docs: clarify stealth init script visibility#353

Merged
D4Vinci merged 5 commits into
D4Vinci:devfrom
mturac:fix/issue-350-init-script-page-action
Jul 4, 2026
Merged

docs: clarify stealth init script visibility#353
D4Vinci merged 5 commits into
D4Vinci:devfrom
mturac:fix/issue-350-init-script-page-action

Conversation

@mturac

@mturac mturac commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • clarify how init_script interacts with Patchright's isolated execution context in Stealthy mode
  • point page_action users to page.evaluate(..., isolated_context=False) when they need to read globals placed on window
  • keep the existing runtime behavior unchanged

Refs #350

Tests

  • git diff --check origin/main...HEAD

@yetval

yetval commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Thanks for this. I think this is patchright working as intended rather than a bug, since the init script does run, it just sits in the isolated world so your evaluate calls can't see it. Anyone who needs it in the main world can already pass isolated_context=False. My honest take is this doesn't really need a code change and a short docs note would cover it, but happy to be wrong.

@mturac mturac changed the title fix: make stealth init scripts available to page actions docs: clarify stealth init script visibility Jun 14, 2026
@mturac

mturac commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Good point, thanks for the context. I replaced the runtime change with a docs-only note that keeps the existing behavior intact and points page_action users to page.evaluate(..., isolated_context=False) when they need to read globals from the page main world.

Copilot AI review requested due to automatic review settings July 4, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@D4Vinci D4Vinci changed the base branch from main to dev July 4, 2026 13:38
@D4Vinci

D4Vinci commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thanks @yetval @mturac

@D4Vinci D4Vinci merged commit e30572b into D4Vinci:dev Jul 4, 2026
@D4Vinci D4Vinci linked an issue Jul 4, 2026 that may be closed by this pull request
1 task
@D4Vinci D4Vinci mentioned this pull request Jul 4, 2026
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.

No context persistence for code loaded using init_script

4 participants