chromiumembedded / java-cef

Java Chromium Embedded Framework (JCEF). A simple framework for embedding Chromium-based browsers in other applications using the Java programming language.
https://bitbucket.org/chromiumembedded/java-cef
Other
602 stars 135 forks source link

CefFrame `evaluateJavascript` #450

Open DatL4g opened 9 months ago

DatL4g commented 9 months ago

Is your feature request related to a problem? Please describe. There is currently no way to execute some javascript and get the value back.

For example we wanna execute this script

(function() {
    const wantedA = document.getElementById("link");
    return wantedA.getAttribute("href");
})();

And get the String of the elements href back in Java.

Describe the solution you'd like This is already implemented in CefSharp like this:

https://github.com/cefsharp/CefSharp/blob/2e2b53f8a1a3ee4839c7d1d18be8fa8b0269139f/CefSharp/IFrame.cs#L129

magreenblatt commented 5 months ago

See https://github.com/chromiumembedded/cef/issues/3631 (and result callback to ExecuteJavaScript)