Skip to content

Commit 8653a57

Browse files
committed
feat(playwright): add clone method
1 parent d8ebe61 commit 8653a57

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

npiai/core/browser/_playwright.py

+9
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ def __init__(
7272
self.channel = channel
7373
self.storage_state = storage_state
7474

75+
async def clone(self):
76+
state = await self.get_state()
77+
78+
return PlaywrightContext(
79+
headless=self.headless,
80+
channel=self.channel,
81+
storage_state=state,
82+
)
83+
7584
async def start(self):
7685
"""Start the Playwright chrome"""
7786
if self.ready:

0 commit comments

Comments
 (0)