fix: Stop removing browser default page

Looks like it's problematic with some systems so it doesn't worth the trouble
This commit is contained in:
Karim shoair
2025-09-15 13:43:47 +03:00
parent 3bf06a8521
commit 7a7097b775
2 changed files with 0 additions and 16 deletions
-8
View File
@@ -173,10 +173,6 @@ class StealthySession(StealthySessionMixin, SyncSession):
**self.launch_options
)
# Get the default page and close it
default_page = self.context.pages[0]
default_page.close()
if self.init_script: # pragma: no cover
self.context.add_init_script(path=self.init_script)
@@ -482,10 +478,6 @@ class AsyncStealthySession(StealthySessionMixin, AsyncSession):
**self.launch_options
)
# Get the default page and close it
default_page = self.context.pages[0]
await default_page.close()
if self.init_script: # pragma: no cover
await self.context.add_init_script(path=self.init_script)
@@ -168,10 +168,6 @@ class DynamicSession(DynamicSessionMixin, SyncSession):
else:
self.context = self.playwright.chromium.launch_persistent_context(user_data_dir="", **self.launch_options)
# Get the default page and close it
default_page = self.context.pages[0]
default_page.close()
if self.init_script: # pragma: no cover
self.context.add_init_script(path=self.init_script)
@@ -421,10 +417,6 @@ class AsyncDynamicSession(DynamicSessionMixin, AsyncSession):
user_data_dir="", **self.launch_options
)
# Get the default page and close it
default_page = self.context.pages[0]
await default_page.close()
if self.init_script: # pragma: no cover
await self.context.add_init_script(path=self.init_script)