Skip to content

Commit 7a67c85

Browse files
committed
chore: roll Playwright to 1.65.0-next (6e2c003f16)
1 parent 18eb47c commit 7a67c85

28 files changed

Lines changed: 434 additions & 164 deletions

‎DRIVER_VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b335271cdc2b57cac2be8ad37c5dd283ac6b8938
1+
6e2c003f16e01822c3ea45bc894c2542a6e98189

‎NODE_VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.22.0
1+
24.22.1

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
66
| :--- | :---: | :---: | :---: |
77
| Chromium <!-- GEN:chromium-version -->156.0.8078.12<!-- GEN:stop --> | ✅ | ✅ | ✅ |
88
| WebKit <!-- GEN:webkit-version -->27.2<!-- GEN:stop --> | ✅ | ✅ | ✅ |
9-
| Firefox <!-- GEN:firefox-version -->157.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
9+
| Firefox <!-- GEN:firefox-version -->158.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
1010

1111
## Documentation
1212

‎playwright/_impl/_protocol.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,12 @@
22072207
},
22082208
"webStorageClear": {"kind": {"type": "enum", "literals": ["local", "session"]}},
22092209
},
2210-
"Root": {"initialize": {"sdkLanguage": "SDKLanguage"}},
2210+
"Root": {
2211+
"initialize": {
2212+
"sdkLanguage": "SDKLanguage",
2213+
"supportsLoneSurrogates": "boolean?",
2214+
}
2215+
},
22112216
"Playwright": {
22122217
"newRequest": {
22132218
"baseURL": "string?",

‎playwright/_impl/browser_context.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import base64
3636
import json
3737
import os
38+
import re
3839
from pathlib import Path
3940
from typing import (
4041
TYPE_CHECKING,
@@ -324,7 +325,9 @@ async def _initialize_har_from_options(
324325
if not record_har_path:
325326
return
326327
default_content: Literal["attach", "embed"] = (
327-
"attach" if str(record_har_path).endswith(".zip") else "embed"
328+
"attach"
329+
if re.search(r"\.zip$", str(record_har_path), re.IGNORECASE)
330+
else "embed"
328331
)
329332
await self.tracing._record_into_har(
330333
har=record_har_path,

‎playwright/_impl/connection.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ async def initialize(self) -> "Playwright":
8383
await self._channel.initialize(
8484
# Python: the SDK language of this client.
8585
sdkLanguage="python",
86+
# json.dumps() escapes a lone surrogate as \udxxx, and json.loads()
87+
# reads it back, as the JS client does.
88+
supportsLoneSurrogates=True,
8689
timeout=NO_TIMEOUT,
8790
)
8891
)["playwright"]

‎playwright/_impl/protocol/validator.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,6 +4181,7 @@
41814181
scheme["RootInitializeParams"] = t_object(
41824182
{
41834183
"sdkLanguage": t_type("SDKLanguage"),
4184+
"supportsLoneSurrogates": t_optional(t_boolean),
41844185
}
41854186
)
41864187
scheme["RootInitializeResult"] = t_object(

‎playwright/_impl/protocol_channels.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4952,11 +4952,15 @@ class RootChannel(Channel):
49524952
def initialize(
49534953
self,
49544954
sdkLanguage: channels.SDKLanguage,
4955+
supportsLoneSurrogates: Optional[bool],
49554956
timeout: float = 0,
49564957
) -> Awaitable[channels.RootInitializeResult]:
49574958
return self._call(
49584959
"initialize",
4959-
{"sdkLanguage": sdkLanguage},
4960+
{
4961+
"sdkLanguage": sdkLanguage,
4962+
"supportsLoneSurrogates": supportsLoneSurrogates,
4963+
},
49604964
timeout,
49614965
lambda result: {"playwright": result["playwright"]},
49624966
is_internal=True,

‎playwright/_impl/tracing.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ async def start_har(
192192
# Not ported: the check of the resourcesDir option against a .zip har file;
193193
# the option is JavaScript only.
194194
default_content: Literal["attach", "embed"] = (
195-
"attach" if str(path).endswith(".zip") else "embed"
195+
"attach" if re.search(r"\.zip$", str(path), re.IGNORECASE) else "embed"
196196
)
197197
self._har_id = await self._record_into_har(
198198
har=path,
@@ -222,7 +222,7 @@ async def _record_into_har(
222222
# Not ported: the resourcesDir option; it is JavaScript only.
223223
# Python: the path can be a pathlib.Path.
224224
har = str(har)
225-
is_zip = har.endswith(".zip")
225+
is_zip = bool(re.search(r"\.zip$", har, re.IGNORECASE))
226226
options: Dict[str, Any] = {
227227
"content": update_content if update_content is not None else "attach",
228228
"urlGlob": url if isinstance(url, str) else None,
@@ -250,7 +250,7 @@ async def _export_har(self, har_id: str) -> None:
250250
return
251251
del self._har_recorders[har_id]
252252
is_local = not self._connection.is_remote()
253-
is_zip = har_params["path"].endswith(".zip")
253+
is_zip = bool(re.search(r"\.zip$", har_params["path"], re.IGNORECASE))
254254

255255
if is_local:
256256
entries = (

‎tests/async/library/test_browsercontext_har.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,20 @@ async def test_HA_085_should_round_trip_har_zip(
292292
server: Server,
293293
tmp_path: Path,
294294
) -> None:
295-
har_path = tmp_path / "har.zip"
295+
har_path = tmp_path / "har.ZIP"
296296
context1 = await context_factory(
297297
record_har_mode="minimal", record_har_path=har_path
298298
)
299299
page1 = await context1.new_page()
300300
await page1.goto(server.PREFIX + "/one-style.html")
301301
await context1.close()
302302

303+
har_dir = tmp_path / "har"
304+
with zipfile.ZipFile(har_path) as zip_file:
305+
zip_file.extractall(har_dir)
306+
log = json.loads((har_dir / "har.har").read_text(encoding="utf-8"))["log"]
307+
assert isinstance(log["entries"][0]["response"]["content"]["_file"], str)
308+
303309
context2 = await context_factory()
304310
await context2.route_from_har(har_path, not_found="abort")
305311
page2 = await context2.new_page()

0 commit comments

Comments
 (0)