perf(StealthySession): Close persistent context default page
This commit is contained in:
@@ -251,6 +251,11 @@ class StealthySession:
|
||||
**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)
|
||||
|
||||
@@ -580,6 +585,11 @@ class AsyncStealthySession(StealthySession):
|
||||
**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