diff --git a/README.md b/README.md index e56df88d03..067d268194 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 127.0.6533.5 | ✅ | ✅ | ✅ | +| Chromium 127.0.6533.17 | ✅ | ✅ | ✅ | | WebKit 17.4 | ✅ | ✅ | ✅ | | Firefox 127.0 | ✅ | ✅ | ✅ | diff --git a/src/Common/Version.props b/src/Common/Version.props index 3f317cd2e8..78ec838cdd 100644 --- a/src/Common/Version.props +++ b/src/Common/Version.props @@ -2,7 +2,7 @@ 1.45.0 $(AssemblyVersion) - 1.45.0-beta-1718782041000 + 1.45.0-beta-1719505820000 $(AssemblyVersion) $(AssemblyVersion) true diff --git a/src/Playwright/API/Generated/IBrowserContext.cs b/src/Playwright/API/Generated/IBrowserContext.cs index b33e6db527..04af5f93e7 100644 --- a/src/Playwright/API/Generated/IBrowserContext.cs +++ b/src/Playwright/API/Generated/IBrowserContext.cs @@ -350,26 +350,6 @@ public partial interface IBrowserContext /// "<div></div>");
/// await page.GetByRole(AriaRole.Button).ClickAsync(); /// - /// An example of passing an element handle: - /// - /// var result = new TaskCompletionSource<string>();
- /// var page = await Context.NewPageAsync();
- /// await Context.ExposeBindingAsync("clicked", async (BindingSource _, IJSHandle t) =>
- /// {
- /// return result.TrySetResult(await t.AsElement().TextContentAsync());
- /// });
- ///
- /// await page.SetContentAsync("<script>\n" +
- /// " document.addEventListener('click', event => window.clicked(event.target));\n" +
- /// "</script>\n" +
- /// "<div>Click me</div>\n" +
- /// "<div>Or click me</div>\n");
- ///
- /// await page.ClickAsync("div");
- /// // Note: it makes sense to await the result here, because otherwise, the context
- /// // gets closed and the binding function will throw an exception.
- /// Assert.AreEqual("Click me", await result.Task); - ///
/// /// Name of the function on the window object. /// Callback function that will be called in the Playwright's context. diff --git a/src/Playwright/API/Generated/IPage.cs b/src/Playwright/API/Generated/IPage.cs index 491dcfa3c1..bd8be3c1a4 100644 --- a/src/Playwright/API/Generated/IPage.cs +++ b/src/Playwright/API/Generated/IPage.cs @@ -794,23 +794,6 @@ public partial interface IPage /// }
/// } /// - /// An example of passing an element handle: - /// - /// var result = new TaskCompletionSource<string>();
- /// await page.ExposeBindingAsync("clicked", async (BindingSource _, IJSHandle t) =>
- /// {
- /// return result.TrySetResult(await t.AsElement().TextContentAsync());
- /// });
- ///
- /// await page.SetContentAsync("<script>\n" +
- /// " document.addEventListener('click', event => window.clicked(event.target));\n" +
- /// "</script>\n" +
- /// "<div>Click me</div>\n" +
- /// "<div>Or click me</div>\n");
- ///
- /// await page.ClickAsync("div");
- /// Console.WriteLine(await result.Task); - ///
/// /// Functions installed via survive navigations. /// Name of the function on the window object. diff --git a/src/Playwright/API/Generated/Options/BrowserContextExposeBindingOptions.cs b/src/Playwright/API/Generated/Options/BrowserContextExposeBindingOptions.cs index 1eb8684c5c..c333f82d21 100644 --- a/src/Playwright/API/Generated/Options/BrowserContextExposeBindingOptions.cs +++ b/src/Playwright/API/Generated/Options/BrowserContextExposeBindingOptions.cs @@ -43,6 +43,7 @@ public BrowserContextExposeBindingOptions(BrowserContextExposeBindingOptions clo } /// + /// **DEPRECATED** This option will be removed in the future. /// /// Whether to pass the argument as a handle, instead of passing by value. When passing /// a handle, only one argument is supported. When passing by value, multiple arguments @@ -50,6 +51,7 @@ public BrowserContextExposeBindingOptions(BrowserContextExposeBindingOptions clo /// /// [JsonPropertyName("handle")] + [System.Obsolete] public bool? Handle { get; set; } } diff --git a/src/Playwright/API/Generated/Options/PageExposeBindingOptions.cs b/src/Playwright/API/Generated/Options/PageExposeBindingOptions.cs index fd05a0bb00..75f44bb82b 100644 --- a/src/Playwright/API/Generated/Options/PageExposeBindingOptions.cs +++ b/src/Playwright/API/Generated/Options/PageExposeBindingOptions.cs @@ -43,6 +43,7 @@ public PageExposeBindingOptions(PageExposeBindingOptions clone) } /// + /// **DEPRECATED** This option will be removed in the future. /// /// Whether to pass the argument as a handle, instead of passing by value. When passing /// a handle, only one argument is supported. When passing by value, multiple arguments @@ -50,6 +51,7 @@ public PageExposeBindingOptions(PageExposeBindingOptions clone) /// /// [JsonPropertyName("handle")] + [System.Obsolete] public bool? Handle { get; set; } } diff --git a/src/Playwright/Core/BrowserContext.cs b/src/Playwright/Core/BrowserContext.cs index 6c13e1260f..3d27b560de 100644 --- a/src/Playwright/Core/BrowserContext.cs +++ b/src/Playwright/Core/BrowserContext.cs @@ -374,7 +374,9 @@ public async Task> CookiesAsync(IEnum [MethodImpl(MethodImplOptions.NoInlining)] public Task ExposeBindingAsync(string name, Action callback, BrowserContextExposeBindingOptions options = default) +#pragma warning disable CS0612 // Type or member is obsolete => ExposeBindingAsync(name, callback, handle: options?.Handle ?? false); +#pragma warning restore CS0612 // Type or member is obsolete [MethodImpl(MethodImplOptions.NoInlining)] public Task ExposeBindingAsync(string name, Action callback) diff --git a/src/Playwright/Core/Page.cs b/src/Playwright/Core/Page.cs index a60e6c44dc..4ea4a9d5d5 100644 --- a/src/Playwright/Core/Page.cs +++ b/src/Playwright/Core/Page.cs @@ -808,7 +808,9 @@ public async Task ReloadAsync(PageReloadOptions options = default) [MethodImpl(MethodImplOptions.NoInlining)] public Task ExposeBindingAsync(string name, Action callback, PageExposeBindingOptions options = default) +#pragma warning disable CS0612 // Type or member is obsolete => InnerExposeBindingAsync(name, (Delegate)callback, options?.Handle ?? false); +#pragma warning restore CS0612 // Type or member is obsolete [MethodImpl(MethodImplOptions.NoInlining)] public Task ExposeBindingAsync(string name, Action callback)