Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->139.0.7258.5<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->140.0.7339.16<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->140.0.2<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->141.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Playwright for .NET is the official language port of [Playwright](https://playwright.dev), the library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.

Expand Down
2 changes: 1 addition & 1 deletion src/Common/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyVersion>1.55.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)-beta-4</PackageVersion>
<DriverVersion>1.54.1</DriverVersion>
<DriverVersion>1.55.0</DriverVersion>
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<NoDefaultExcludes>true</NoDefaultExcludes>
Expand Down
46 changes: 23 additions & 23 deletions src/Playwright.TestingHarnessTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Playwright.TestingHarnessTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "playwright.testingharnesstest",
"private": true,
"devDependencies": {
"@playwright/test": "1.54.1",
"@playwright/test": "1.55.0",
"@types/node": "^22.12.0",
"fast-xml-parser": "^4.5.0"
}
Expand Down
90 changes: 0 additions & 90 deletions src/Playwright.Tests/ChromiumLauncherTests.cs

This file was deleted.

7 changes: 7 additions & 0 deletions src/Playwright.Tests/InterceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ bool URLMatches(string baseURL, string url, string glob)
Assert.True(URLMatches("http://playwright.dev", "http://playwright.dev/?x=y", "?x=y"));
Assert.True(URLMatches("http://playwright.dev/foo/", "http://playwright.dev/foo/bar?x=y", "./bar?x=y"));

// Case insensitive matching
Assert.True(URLMatches(null, "https://playwright.dev/fooBAR", "HtTpS://pLaYwRiGhT.dEv/fooBAR"));
Assert.True(URLMatches("http://ignored", "https://playwright.dev/fooBAR", "HtTpS://pLaYwRiGhT.dEv/fooBAR"));
// Path and search query are case-sensitive
Assert.False(URLMatches(null, "https://playwright.dev/foobar", "https://playwright.dev/fooBAR"));
Assert.False(URLMatches(null, "https://playwright.dev/foobar?a=b", "https://playwright.dev/foobar?A=B"));

// This is not supported, we treat ? as a query separator.
Assert.That("http://localhost:8080/Simple/path.js", Does.Not.Match(GlobToRegex("http://localhost:8080/?imple/path.js")));
Assert.False(URLMatches(null, "http://playwright.dev/", "http://playwright.?ev"));
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions src/Playwright.Tests/assets/simple-extension/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/Playwright.Tests/assets/simple-extension/manifest.json

This file was deleted.

6 changes: 6 additions & 0 deletions src/Playwright/API/Generated/IBrowserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ public partial interface IBrowserType
/// seen at <c>chrome://version</c>.
/// Note that browsers do not allow launching multiple instances with the same User
/// Data Directory.
/// Chromium/Chrome: Due to recent Chrome policy changes, automating the default Chrome
/// user profile is not supported. Pointing <c>userDataDir</c> to Chrome's main "User
/// Data" directory (the profile used for your regular browsing) may result in pages
/// not loading or the browser exiting. Create and use a separate directory (for example,
/// an empty folder) as your automation profile instead. See https://developer.chrome.com/blog/remote-debugging-port
/// for details.
/// </param>
/// <param name="options">Call options</param>
Task<IBrowserContext> LaunchPersistentContextAsync(string userDataDir, BrowserTypeLaunchPersistentContextOptions? options = default);
Expand Down
2 changes: 1 addition & 1 deletion src/Playwright/API/Generated/IPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ public partial interface IPage
/// <summary>
/// <para>
/// Pauses script execution. Playwright will stop executing the script and wait for
/// the user to either press 'Resume' button in the page overlay or to call <c>playwright.resume()</c>
/// the user to either press the 'Resume' button in the page overlay or to call <c>playwright.resume()</c>
/// in the DevTools console.
/// </para>
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public APIRequestNewContextOptions(APIRequestNewContextOptions clone)
/// that the certificate is valid for.
/// </para>
/// <para>
/// Client certificate authentication is only active when at least one client certificate
/// is provided. If you want to reject all client certificates sent by the server, you
/// need to provide a client certificate with an <c>origin</c> that does not match any
/// of the domains you plan to visit.
/// </para>
/// <para>
/// When using WebKit on macOS, accessing <c>localhost</c> will not pick up client certificates.
/// You can make it work by replacing <c>localhost</c> with <c>local.playwright</c>.
/// </para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ public BrowserNewContextOptions(BrowserNewContextOptions clone)
/// that the certificate is valid for.
/// </para>
/// <para>
/// Client certificate authentication is only active when at least one client certificate
/// is provided. If you want to reject all client certificates sent by the server, you
/// need to provide a client certificate with an <c>origin</c> that does not match any
/// of the domains you plan to visit.
/// </para>
/// <para>
/// When using WebKit on macOS, accessing <c>localhost</c> will not pick up client certificates.
/// You can make it work by replacing <c>localhost</c> with <c>local.playwright</c>.
/// </para>
Expand Down
6 changes: 6 additions & 0 deletions src/Playwright/API/Generated/Options/BrowserNewPageOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ public BrowserNewPageOptions(BrowserNewPageOptions clone)
/// that the certificate is valid for.
/// </para>
/// <para>
/// Client certificate authentication is only active when at least one client certificate
/// is provided. If you want to reject all client certificates sent by the server, you
/// need to provide a client certificate with an <c>origin</c> that does not match any
/// of the domains you plan to visit.
/// </para>
/// <para>
/// When using WebKit on macOS, accessing <c>localhost</c> will not pick up client certificates.
/// You can make it work by replacing <c>localhost</c> with <c>local.playwright</c>.
/// </para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont
/// that the certificate is valid for.
/// </para>
/// <para>
/// Client certificate authentication is only active when at least one client certificate
/// is provided. If you want to reject all client certificates sent by the server, you
/// need to provide a client certificate with an <c>origin</c> that does not match any
/// of the domains you plan to visit.
/// </para>
/// <para>
/// When using WebKit on macOS, accessing <c>localhost</c> will not pick up client certificates.
/// You can make it work by replacing <c>localhost</c> with <c>local.playwright</c>.
/// </para>
Expand Down
39 changes: 32 additions & 7 deletions src/Playwright/Helpers/URLMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ internal static string ConstructURLBasedOnBaseURL(string? baseUrl, string url)
{
try
{
if (string.IsNullOrEmpty(baseUrl))
{
return FixupTrailingSlash(new Uri(url, UriKind.Absolute)).ToString();
}
return FixupTrailingSlash(new Uri(new Uri(baseUrl), new Uri(url, UriKind.RelativeOrAbsolute))).ToString();
return ResolveBaseURL(baseUrl, url).Resolved;
}
catch
{
Expand Down Expand Up @@ -254,16 +250,45 @@ string MapToken(string original, string replacement)
return newPrefix + newSuffix;
}));

var resolved = ConstructURLBasedOnBaseURL(baseURL, relativePath);
var (resolved, caseInsensitivePart) = ResolveBaseURL(baseURL, relativePath);
foreach (var kvp in tokenMap)
{
resolved = resolved.Replace(kvp.Key, kvp.Value);
var normalize = caseInsensitivePart?.Contains(kvp.Key) == true;
resolved = resolved.Replace(kvp.Key, normalize ? kvp.Value.ToLowerInvariant() : kvp.Value);
}
match = resolved;
}
return match;
}

private static (string Resolved, string? CaseInsensitivePart) ResolveBaseURL(string? baseUrl, string url)
{
try
{
Uri uri;
if (string.IsNullOrEmpty(baseUrl))
{
uri = FixupTrailingSlash(new Uri(url, UriKind.Absolute));
}
else
{
uri = FixupTrailingSlash(new Uri(new Uri(baseUrl), new Uri(url, UriKind.RelativeOrAbsolute)));
}
var resolved = uri.ToString();
// Schema and domain are case-insensitive.
var caseInsensitivePrefix = $"{uri.Scheme}://{uri.Host}";
if (!uri.IsDefaultPort)
{
caseInsensitivePrefix += $":{uri.Port}";
}
return (resolved, caseInsensitivePrefix);
}
catch
{
return (url, null);
}
}

public bool Equals(string? globMatch, Regex? reMatch, Func<string, bool>? funcMatch, string? baseURL, bool isWebSocketUrl)
{
return this.re?.ToString() == reMatch?.ToString() && this.re?.Options == reMatch?.Options
Expand Down
Loading
Loading