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
655 stars 147 forks source link

CefFrame `evaluateJavascript` #450

Open DatL4g opened 1 year ago

DatL4g commented 1 year 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 10 months ago

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