DOT-6319: Add support for custom cookies #378
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for handling custom cookies in the snapshot processing workflow, allowing cookies that can't be set via JavaScript (such as httpOnly, secure, and sameSite variants) to be injected via the snapshot options. It also introduces schema validation for these custom cookies and improves navigation reliability by waiting for the network to become idle after navigation.
Custom Cookies Support:
customCookies
field to theSnapshot
options, allowing users to specify cookies (including httpOnly, secure, and sameSite) that are not accessible viadocument.cookie
. These cookies are validated for required fields and correctsameSite
values before being set in the browser context. [1] [2] [3]customCookies
array, ensuring the structure and types of custom cookies are checked before processing.Navigation Reliability:
networkidle
state (with a 30s timeout) to ensure the page has finished loading resources, improving the reliability of snapshot captures.Minor Code Quality Improvements: