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

Add CefFrame::ExecuteJavaScript variant with result callback #3631

Open
magreenblatt opened this issue Jan 14, 2024 · 0 comments
Open

Add CefFrame::ExecuteJavaScript variant with result callback #3631

magreenblatt opened this issue Jan 14, 2024 · 0 comments
Labels
enhancement Enhancement request

Comments

@magreenblatt
Copy link
Collaborator

magreenblatt commented Jan 14, 2024

Is your feature request related to a problem? Please describe.
The existing CefFrame::ExecuteJavaScript method does not currently support a result callback. The related Chromium implementation (RenderFrameHost::ExecuteJavaScript) does support a result callback.

Describe the solution you'd like
Add a variant of CefFrame::ExecuteJavaScript with a result callback.

Describe alternatives you've considered
Result callback functionality can currently be implemented using CefV8Context::Eval and CefMessageRouter. However, that is substantially more complicated for clients.

Additional context
It might also be nice to expose ExecuteJavaScriptMethod as an alternative to ExecuteJavaScript. From the Chromium docs:

  // This API allows to execute JavaScript methods in this frame, without
  // having to serialize the arguments into a single string, and is a lot
  // cheaper than ExecuteJavaScript below since it avoids the need to compile
  // and evaluate new scripts all the time.
  //
  // Calling
  //
  //   ExecuteJavaScriptMethod("obj", "foo", [1, true], callback)
  //
  // is semantically equivalent to
  //
  //   ExecuteJavaScript("obj.foo(1, true)", callback)

This would also benefit from a more concise way to construct CefListValue objects (e.g. [1, true] in the above example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement request
Projects
None yet
Development

No branches or pull requests

1 participant