Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for passing IJSHandle as argument to EvaluateFunctionAsync/EvaluateFunctionHandleAsync #2038

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

amaitland
Copy link
Contributor

@amaitland amaitland commented Nov 8, 2022

Motivation for this change is to allow for PuppeteerSharp.Dom to pass it's custom DOM object instances as IJSHandle args to EvaluateFunctionAsync/EvaluateFunctionHandleAsync.

Currently you have to cast to JSHandle. e.g. https://github.com/ChromiumDotNet/PuppeteerSharp.Dom/blob/b1f862ee24dcc2a025dfea43d198597dbdedf17c/PuppeteerSharp.Dom.Tests/ElementHandleTests/BoundingBoxTests.cs#L61

…uateFunctionHandleAsync

- Update ExecutionContext.FormatArgument to match IJSHandle instead of JSHandle
- Make RemoteObjectHelper class static
- Move JSHandle.FormatArgument to RemoteObjectHelper.FormatArgument (extension method)
- IJSHandle.RemoteObject fix xml doc
@amaitland amaitland force-pushed the enhancement/allowpassingijshandle branch from c56cee2 to c5a3b39 Compare November 17, 2022 00:34
@kblok kblok merged commit 3c91d1d into hardkoded:master Nov 17, 2022
@amaitland amaitland deleted the enhancement/allowpassingijshandle branch November 17, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants