Extending WebBrowser with GetSource and BindUObject

I’m attempting to extend the WebBrowser widget to implement the GetSource and BindUObject/UnbindUObject functions. The former returns the HTML content and the latter respectively binds and unbinds a UObject instance to the browser to expose properties and functions to Javascript to send data between Unreal and the browser.

GetSource needs to be called asynchronously and passes a TFunction as parameter for the callback. The BindUObject function takes an FString and a UObject pointer as parameters, but the communication is asynchronous and uses “JS Future” objects to return the values. All according to the comments in the source code.

Unfortunately, I don’t know how to call GetSource to set up a callback, or how to get the results back from UObjects bound to the browser. I understand the basics of asynchronous execution and binding delegates, but since the WebBrowser uses CEF I don’t know how to work with that.

Hi,
Did you finally find the solution? I’m interesting…
Thanks

Lookup GetUrl in the web browser widget. Duplicate that function in the whole hierarchy until you are in FCEFWebBrowserWindow.
From there you can return MainFrame->GetSource.
Not tested but I think this would be a good starting point.