Skip to content

Commit aee181c

Browse files
authored
fix browser cdp connection (#3339)
1 parent 275426e commit aee181c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

skyvern/webeye/browser_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ async def check_and_fix_state(
657657

658658
if await self.get_working_page() is None:
659659
page: Page | None = None
660+
use_existing_page = False
660661
if browser_address and len(self.browser_context.pages) > 0:
661662
pages = [
662663
http_page
@@ -665,11 +666,13 @@ async def check_and_fix_state(
665666
]
666667
if len(pages) > 0:
667668
page = pages[0]
669+
use_existing_page = True
668670
if page is None:
669671
page = await self.browser_context.new_page()
670672

671673
await self.set_working_page(page, 0)
672-
await self._close_all_other_pages()
674+
if not use_existing_page:
675+
await self._close_all_other_pages()
673676

674677
if url:
675678
await self.navigate_to_url(page=page, url=url)

0 commit comments

Comments
 (0)