-
Notifications
You must be signed in to change notification settings - Fork 12
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
New functions? #3
Comments
Hi, this project is pretty much dead. I've added C++ -> javascript integration to use in another project and that was pretty much it. It sets a javascript object from C++ side so you can access the variables in javascript. |
is a great project, awesomium has been unavailable for a long time, I ended up finding your project, apparently it is very light because it is an old version of cef, it is good for games Cef3DJsValue test("test", "my string"); |
That would be https://github.com/arkenthera/cef3d/tree/develop/Demos/MMD_Nowplaying |
It's what I tested, it's giving undefined, I thought it would be another way :( |
When are you calling |
Cef3DRenderer::OnProcessMessageReceived SampleBrowser::OnAfterCreated My html code: <!DOCTYPE html>
<html>
<head>
<script>
window.addEventListener('load', function() {
var myelement = document.getElementById("xx");
myelement.innerHTML = window.test;
})
</script>
</head>
<div id="xx">???</div>
</body>
</html> Is there any way to send javascript values to the client like in awesomium? The only way I found it was using V8::Execute in the subprocess, however, it does not have access to client variables to return the requested values in javascript |
Yes, though that is a little more complicated. In the video below i was using a color picker from html side to send color values to c++. I will do a write-up when i have time(sometime today) about how you can do that. |
oh ok, thank you very much :P |
So, here I will try to explain but bear with me since its been few years since I last worked on this. To be able to call C++ code from Javascript, first you need an "extension". The extension is a javascript code which will be uploaded by renderer process. Internally, when this javascript code is called on the client, it will call Note that all javascript stuff happens in Renderer process so you need to do IPC messaging to communicate with it. Below I will list sample code step by step so you can inspect it and implement yourself. Here is a sample extension code. Attention to the When, for example, Then in browser process, we catch this IPC and after that its up to you to whatever you want with it. Here is an example of turning a check box on and off, and letting the C++ side know about it.
This will then be catched here. I hope this helps! |
I am very grateful for the explanation and the codes shown I finally managed to make interaction |
I am not really sure what's happening there. Maybe check if |
Just saw your edit, nice! |
Hello, i noticed that your branch develop has some functions but I did not see any use of them, could you tell me what it does?
Cef3DBrowser::CreateJsObject
thank you
The text was updated successfully, but these errors were encountered: