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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user