feat(browser sessions): Collect XHR requests done while loading the page

Solves #159
This commit is contained in:
Karim shoair
2026-03-29 22:53:54 +02:00
parent 0f6dcccf5f
commit 68f7c5c36f
7 changed files with 135 additions and 36 deletions
@@ -87,6 +87,7 @@ class PlaywrightConfig(Struct, kw_only=True, frozen=False, weakref=True):
blocked_domains: Optional[Set[str]] = None
retries: RetriesCount = 3
retry_delay: Seconds = 1
capture_xhr: str | None = None
def __post_init__(self): # pragma: no cover
"""Custom validation after msgspec validation"""
@@ -112,6 +113,8 @@ class PlaywrightConfig(Struct, kw_only=True, frozen=False, weakref=True):
self.selector_config = {}
if not self.additional_args:
self.additional_args = {}
if not self.capture_xhr:
self.capture_xhr = None
if self.init_script is not None:
validation_msg = _is_invalid_file_path(self.init_script)