Skip to content

Commit 02fb88a

Browse files
committed
fix(connect): when using a large payload
1 parent a02f10b commit 02fb88a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

playwright/_impl/_transport.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ async def wait_until_stopped(self) -> None:
210210
async def connect(self) -> None:
211211
try:
212212
self._connection = await websocket_connect(
213-
self.ws_endpoint, extra_headers=self.headers
213+
self.ws_endpoint,
214+
extra_headers=self.headers,
215+
max_size=256 * 1024 * 1024, # 256Mb
214216
)
215217
except Exception as exc:
216218
self.on_error_future.set_exception(Error(f"websocket.connect: {str(exc)}"))
@@ -245,6 +247,6 @@ async def run(self) -> None:
245247

246248
def send(self, message: Dict) -> None:
247249
if self._stopped or (hasattr(self, "_connection") and self._connection.closed):
248-
raise Error("Playwright connection closed")
250+
raise Error("Playwright connection closed3")
249251
data = self.serialize_message(message)
250252
self._loop.create_task(self._connection.send(data))

0 commit comments

Comments
 (0)