refactor context tree (#212)

This commit is contained in:
LawyZheng
2024-04-21 22:30:37 +08:00
committed by GitHub
parent 02db2a90e6
commit cc6ae8bae0
4 changed files with 217 additions and 63 deletions

View File

@@ -135,11 +135,13 @@ class BrowserState:
browser_context: BrowserContext | None = None,
page: Page | None = None,
browser_artifacts: BrowserArtifacts = BrowserArtifacts(),
new_context_tree: bool = False,
):
self.pw = pw
self.browser_context = browser_context
self.page = page
self.browser_artifacts = browser_artifacts
self.new_context_tree = new_context_tree
async def _close_all_other_pages(self) -> None:
if not self.browser_context or not self.page: