Skip to content

Commit c62ec5a

Browse files
committed
u
1 parent a57f1f3 commit c62ec5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

akari_bot_webrender/functions/browser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ async def browser_init(self, browse_type: Literal["chrome", "chromium", "firefox
6262
return True
6363

6464
async def close(self):
65+
for context in self.contexts.values():
66+
await context.close()
67+
self.contexts = {}
6568
await self.browser.close()
6669
await self.playwright.stop()
67-
self.playwright = None
6870
self.browser = None
71+
self.playwright = None
6972

7073
async def new_page(self, width: int = base_width, height: int = base_height, locale: str = "zh_cn", stealth: bool = True):
7174
if f"{width}x{height}" not in self.contexts:

0 commit comments

Comments
 (0)