Skip to content

Conversation

lt-zeeshan
Copy link
Contributor

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:

  • Added a customCookies field to the Snapshot options, allowing users to specify cookies (including httpOnly, secure, and sameSite) that are not accessible via document.cookie. These cookies are validated for required fields and correct sameSite values before being set in the browser context. [1] [2] [3]
  • Updated the JSON schema validation to include the customCookies array, ensuring the structure and types of custom cookies are checked before processing.

Navigation Reliability:

  • After navigation, added a wait for the networkidle state (with a 30s timeout) to ensure the page has finished loading resources, improving the reliability of snapshot captures.

Minor Code Quality Improvements:

  • Removed an unused or redundant variable assignment and cleaned up commented code for better maintainability. [1] [2]

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