Skip to content

Commit 3cbe13e

Browse files
authored
chore: roll to 1.55.0 (#2956)
1 parent 254aabd commit 3cbe13e

File tree

18 files changed

+352
-92
lines changed

18 files changed

+352
-92
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
44

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->139.0.7258.5<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->140.0.7339.16<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->140.0.2<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->141.0<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

playwright/_impl/_helper.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
Optional,
3030
Pattern,
3131
Set,
32+
Tuple,
3233
TypedDict,
3334
TypeVar,
3435
Union,
@@ -221,14 +222,35 @@ def map_token(original: str, replacement: str) -> str:
221222
processed_parts.append(new_prefix + new_suffix)
222223

223224
relative_path = "/".join(processed_parts)
224-
resolved_url = urljoin(base_url if base_url is not None else "", relative_path)
225+
resolved_url, case_insensitive_part = resolve_base_url(base_url, relative_path)
225226

226227
for replacement, original in token_map.items():
227-
resolved_url = resolved_url.replace(replacement, original, 1)
228+
normalize = case_insensitive_part and replacement in case_insensitive_part
229+
resolved_url = resolved_url.replace(
230+
replacement, original.lower() if normalize else original, 1
231+
)
228232

229233
return ensure_trailing_slash(resolved_url)
230234

231235

236+
def resolve_base_url(
237+
base_url: Optional[str], given_url: str
238+
) -> Tuple[str, Optional[str]]:
239+
try:
240+
resolved = urljoin(base_url if base_url is not None else "", given_url)
241+
parsed = urlparse(resolved)
242+
# Schema and domain are case-insensitive.
243+
hostname_port = (
244+
parsed.hostname or ""
245+
) # can't use parsed.netloc because it includes userinfo (username:password)
246+
if parsed.port:
247+
hostname_port += f":{parsed.port}"
248+
case_insensitive_prefix = f"{parsed.scheme}://{hostname_port}"
249+
return resolved, case_insensitive_prefix
250+
except Exception:
251+
return given_url, None
252+
253+
232254
# In Node.js, new URL('http://localhost') returns 'http://localhost/'.
233255
# To ensure the same url matching behavior, do the same.
234256
def ensure_trailing_slash(url: str) -> str:

playwright/async_api/_generated.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11487,8 +11487,8 @@ async def main():
1148711487
async def pause(self) -> None:
1148811488
"""Page.pause
1148911489

11490-
Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume'
11491-
button in the page overlay or to call `playwright.resume()` in the DevTools console.
11490+
Pauses script execution. Playwright will stop executing the script and wait for the user to either press the
11491+
'Resume' button in the page overlay or to call `playwright.resume()` in the DevTools console.
1149211492

1149311493
User can inspect selectors or perform manual steps while paused. Resume will continue running the original script
1149411494
from the place it was paused.
@@ -13921,6 +13921,10 @@ async def new_context(
1392113921
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1392213922
with an exact match to the request origin that the certificate is valid for.
1392313923

13924+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
13925+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
13926+
does not match any of the domains you plan to visit.
13927+
1392413928
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1392513929
work by replacing `localhost` with `local.playwright`.
1392613930

@@ -14152,6 +14156,10 @@ async def new_page(
1415214156
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1415314157
with an exact match to the request origin that the certificate is valid for.
1415414158

14159+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
14160+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
14161+
does not match any of the domains you plan to visit.
14162+
1415514163
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1415614164
work by replacing `localhost` with `local.playwright`.
1415714165

@@ -14559,6 +14567,13 @@ async def launch_persistent_context(
1455914567
**parent** directory of the "Profile Path" seen at `chrome://version`.
1456014568

1456114569
Note that browsers do not allow launching multiple instances with the same User Data Directory.
14570+
14571+
**NOTE** Chromium/Chrome: Due to recent Chrome policy changes, automating the default Chrome user profile is not
14572+
supported. Pointing `userDataDir` to Chrome's main "User Data" directory (the profile used for your regular
14573+
browsing) may result in pages not loading or the browser exiting. Create and use a separate directory (for example,
14574+
an empty folder) as your automation profile instead. See https://developer.chrome.com/blog/remote-debugging-port
14575+
for details.
14576+
1456214577
channel : Union[str, None]
1456314578
Browser distribution channel.
1456414579

@@ -14733,6 +14748,10 @@ async def launch_persistent_context(
1473314748
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1473414749
with an exact match to the request origin that the certificate is valid for.
1473514750

14751+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
14752+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
14753+
does not match any of the domains you plan to visit.
14754+
1473614755
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1473714756
work by replacing `localhost` with `local.playwright`.
1473814757

@@ -18801,6 +18820,10 @@ async def new_context(
1880118820
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1880218821
with an exact match to the request origin that the certificate is valid for.
1880318822

18823+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
18824+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
18825+
does not match any of the domains you plan to visit.
18826+
1880418827
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1880518828
work by replacing `localhost` with `local.playwright`.
1880618829

playwright/sync_api/_generated.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11569,8 +11569,8 @@ def run(playwright: Playwright):
1156911569
def pause(self) -> None:
1157011570
"""Page.pause
1157111571

11572-
Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume'
11573-
button in the page overlay or to call `playwright.resume()` in the DevTools console.
11572+
Pauses script execution. Playwright will stop executing the script and wait for the user to either press the
11573+
'Resume' button in the page overlay or to call `playwright.resume()` in the DevTools console.
1157411574

1157511575
User can inspect selectors or perform manual steps while paused. Resume will continue running the original script
1157611576
from the place it was paused.
@@ -12255,7 +12255,7 @@ def add_locator_handler(
1225512255

1225612256
```py
1225712257
# Setup the handler.
12258-
def handler():
12258+
async def handler():
1225912259
await page.get_by_role(\"button\", name=\"No thanks\").click()
1226012260
await page.add_locator_handler(page.get_by_text(\"Sign up to the newsletter\"), handler)
1226112261

@@ -12268,7 +12268,7 @@ def handler():
1226812268

1226912269
```py
1227012270
# Setup the handler.
12271-
def handler():
12271+
async def handler():
1227212272
await page.get_by_role(\"button\", name=\"Remind me later\").click()
1227312273
await page.add_locator_handler(page.get_by_text(\"Confirm your security details\"), handler)
1227412274

@@ -12283,7 +12283,7 @@ def handler():
1228312283

1228412284
```py
1228512285
# Setup the handler.
12286-
def handler():
12286+
async def handler():
1228712287
await page.evaluate(\"window.removeObstructionsForTestIfNeeded()\")
1228812288
await page.add_locator_handler(page.locator(\"body\"), handler, no_wait_after=True)
1228912289

@@ -12296,7 +12296,7 @@ def handler():
1229612296
invocations by setting `times`:
1229712297

1229812298
```py
12299-
def handler(locator):
12299+
async def handler(locator):
1230012300
await locator.click()
1230112301
await page.add_locator_handler(page.get_by_label(\"Close\"), handler, times=1)
1230212302
```
@@ -13952,6 +13952,10 @@ def new_context(
1395213952
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1395313953
with an exact match to the request origin that the certificate is valid for.
1395413954

13955+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
13956+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
13957+
does not match any of the domains you plan to visit.
13958+
1395513959
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1395613960
work by replacing `localhost` with `local.playwright`.
1395713961

@@ -14185,6 +14189,10 @@ def new_page(
1418514189
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1418614190
with an exact match to the request origin that the certificate is valid for.
1418714191

14192+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
14193+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
14194+
does not match any of the domains you plan to visit.
14195+
1418814196
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1418914197
work by replacing `localhost` with `local.playwright`.
1419014198

@@ -14598,6 +14606,13 @@ def launch_persistent_context(
1459814606
**parent** directory of the "Profile Path" seen at `chrome://version`.
1459914607

1460014608
Note that browsers do not allow launching multiple instances with the same User Data Directory.
14609+
14610+
**NOTE** Chromium/Chrome: Due to recent Chrome policy changes, automating the default Chrome user profile is not
14611+
supported. Pointing `userDataDir` to Chrome's main "User Data" directory (the profile used for your regular
14612+
browsing) may result in pages not loading or the browser exiting. Create and use a separate directory (for example,
14613+
an empty folder) as your automation profile instead. See https://developer.chrome.com/blog/remote-debugging-port
14614+
for details.
14615+
1460114616
channel : Union[str, None]
1460214617
Browser distribution channel.
1460314618

@@ -14772,6 +14787,10 @@ def launch_persistent_context(
1477214787
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1477314788
with an exact match to the request origin that the certificate is valid for.
1477414789

14790+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
14791+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
14792+
does not match any of the domains you plan to visit.
14793+
1477514794
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1477614795
work by replacing `localhost` with `local.playwright`.
1477714796

@@ -18922,6 +18941,10 @@ def new_context(
1892218941
`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
1892318942
with an exact match to the request origin that the certificate is valid for.
1892418943

18944+
Client certificate authentication is only active when at least one client certificate is provided. If you want to
18945+
reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
18946+
does not match any of the domains you plan to visit.
18947+
1892518948
**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
1892618949
work by replacing `localhost` with `local.playwright`.
1892718950

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import zipfile
2222
from typing import Dict
2323

24-
driver_version = "1.54.1"
24+
driver_version = "1.55.0"
2525

2626
base_wheel_bundles = [
2727
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Mock script for background extension
2-
window.MAGIC = 42;
2+
globalThis.MAGIC = 42;

tests/assets/simple-extension/manifest.json renamed to tests/assets/extension-mv3-simple/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"name": "Simple extension",
33
"version": "0.1",
44
"background": {
5-
"scripts": ["index.js"]
5+
"service_worker": "index.js"
66
},
77
"content_scripts": [{
88
"matches": ["<all_urls>"],
99
"css": [],
1010
"js": ["content-script.js"]
1111
}],
1212
"permissions": ["background", "activeTab"],
13-
"manifest_version": 2
13+
"manifest_version": 3
1414
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
console.log("Service worker script loaded");
2+
3+
chrome.runtime.onInstalled.addListener(() => {
4+
console.log("Extension installed");
5+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Test console log from a third-party execution context");

0 commit comments

Comments
 (0)