Skip to content

Commit

Permalink
Fix transfer handle
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok committed Nov 15, 2023
1 parent 88b45a0 commit 404c92b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions lib/PuppeteerSharp/IsolatedWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ internal override async Task<IJSHandle> TransferHandleAsync(IJSHandle handle)
return handle;
}

if (handle.RemoteObject.ObjectId == null)
{
return handle;
}

var info = await Client.SendAsync<DomDescribeNodeResponse>(
"DOM.describeNode",
new DomDescribeNodeRequest
Expand Down
11 changes: 6 additions & 5 deletions lib/PuppeteerSharp/JSHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ internal JSHandle(IsolatedWorld world, RemoteObject remoteObject)

/// <inheritdoc/>
public Task<IJSHandle> GetPropertyAsync(string propertyName)
=> EvaluateFunctionHandleAsync(
@"(object, propertyName) => {
return object[propertyName];
}",
propertyName);
=> BindIsolatedHandleAsync(handle =>
handle.EvaluateFunctionHandleAsync(
@"(object, propertyName) => {
return object[propertyName];
}",
propertyName));

/// <inheritdoc/>
public Task<Dictionary<string, IJSHandle>> GetPropertiesAsync()
Expand Down

0 comments on commit 404c92b

Please sign in to comment.