Skip to content

Commit

Permalink
Add warning in browser.py:create_session()
Browse files Browse the repository at this point in the history
  • Loading branch information
neyberson committed Sep 6, 2024
1 parent ec0957d commit 32614cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion devtools/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ async def create_session(self):
raise RuntimeError(
"There is no eventloop, or was not passed to browser. Cannot use async methods"
)
warnings.warn(
"This method only works with some versions of Chrome, it is experimental"
)
response = await self.browser.send_command(
"Target.attachToBrowserTarget", params=dict(targetId=self.target_id, flatten=True)
"Target.attachToBrowserTarget",
params=dict(targetId=self.target_id, flatten=True),
)
if "error" in response:
raise RuntimeError("Could not create session") from Exception(
Expand Down

0 comments on commit 32614cf

Please sign in to comment.