diff --git a/lib/PuppeteerSharp/ElementHandle.cs b/lib/PuppeteerSharp/ElementHandle.cs index 285fc8f5c..47603ea6d 100644 --- a/lib/PuppeteerSharp/ElementHandle.cs +++ b/lib/PuppeteerSharp/ElementHandle.cs @@ -292,7 +292,7 @@ public Task QuerySelectorAllHandleAsync(string selector) var handles = await handle.QuerySelectorAllAsync(selector).ConfigureAwait(false); - var elements = await EvaluateFunctionHandleAsync( + var elements = await handle.EvaluateFunctionHandleAsync( @"(_, ...elements) => { return elements; }", diff --git a/lib/PuppeteerSharp/IsolatedWorld.cs b/lib/PuppeteerSharp/IsolatedWorld.cs index 836601bc5..55fcb4e28 100644 --- a/lib/PuppeteerSharp/IsolatedWorld.cs +++ b/lib/PuppeteerSharp/IsolatedWorld.cs @@ -109,7 +109,7 @@ internal override async Task AdoptBackendNodeAsync(object backen internal override async Task TransferHandleAsync(IJSHandle handle) { - if ((handle as JSHandle)?.Realm == this) + if ((handle as JSHandle)?.Realm.Client == Client) { return handle; }