-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
CEF3: Support JS bindings again #159
Comments
…process, which we are able to call from the main process. The next step is to try and make it execute Javascript in the proper CefFrame. Might not be so incredibly simple, but we'll have to give it a try and see.
…a bit, to try and get it working with the cross-process scenario which is a reality w/ CEF3.
…avascript execution over to the CefFrame in the render process, but it doesn't seem to work yet… Have to check with Marshall & friends.
… was also highly non-functional...) earlier because it caused stability problems, since CEF starts up more than 1 child process sometimes (which caused problems). I think we might have to distinguish between different process types here, which is why we start fiddling around with the arguments. Perhaps there are other, better ways to detect the current process type though.
…y use the CefBrowser object on the "wrong" thread, even though we are in the render process. Time to roll up our sleeves and start doing some CefPostTask() work I think...
…TA... and also, I cannot for some odd reason attach to the process with the debugger, which I hope I will be able to with C#.
…ich is debuggable and hence a HUGE plus in what we are trying to achieve...). Will also consider using the C API for CEF, since I think it actually will suit us better.
…a get that one solved actually... Well, of course we are, but how well with it work? Anyway, time to go to bed now and so forth.
(EvaluateScript stuff is quite far actually. Will start working on the JS bindings also asap.) |
…y in use, so we must send in a request to terminate the endpoint if it’s already there…
…that will let us run our Javascript code.
i would like too take care of this one i will start by looking at the code of CefSharp1 branch and port the changes. i suspect the JavaScript proxy has to get involved in object binding too!? |
Great! This one is a bit challenging. Start off by forking off of the latest In this case, I really want us to be careful in making small, atomic commits, which can easily be cherry-picked and analyzed as individual items. As you say, the Javascript proxy (which is actually a WCF host using named pipes as the communication channel) has to be involved. The challenge here is to get the information about the types (that are registered in the parent process) to be transmitted to the actual CEF/browser thread (which is running in the render process). That's the sole reason for why I set up this WCF thing in the first place. So, transfer some form of data structure to it, with a list of the types eligible for registration. Each type should then have a list of properties and methods which are being registered. You can play around with it for a while and see how far you get. Feel free to submit a "WIP PR" then, in which we can discuss things further. Thanks for your interest in this one! |
oki i perfectly understand all your points. my first change will be to create proxy objects in the browserprocess which wrapp the registered objects and provide Ids for each object so we can identify them and add serializable objects for the wcf. for my understanding: is the communication oneway or should the values be written back to the objects in the browserprocess when they are changed by javascript. if they dont need to be written back i think i dont need that id think and just add serializable proxy objects how complex can the objects be ? is it possible to register a complex object with Properties that have backlinks to the parentobjects? thats importent thing to know for the object identification for method binding: here i think i just intercept the requested call send it to the browserprocess and execute it there and return the result to the renderprocess. |
Ideally, they would be written back to the objects in the browser process, even though I assume this complicates things a bit... Could it be solved by means of WCF events/callbacks perhaps?
I don't think we have to support that level of complexity at the moment, no.
Sounds like a plan. 😃 |
Btw, it would also be cool (at some point) to be able to play around with I guess this is quite hard though, so we don't have to do that at this stage. For the actual type interrogation stuff, take a look at the Btw - please do not submit this as one fat, big PR in the end. 😃 It will be impossible to merge. Instead, as always, try to work in small steps that we can merge on at a time and so forth... |
did you say something i didnt hear anything. all you mention above can be done its all about getting a clever interface. it is only a matter of how to address stuff i really would like to make the DOM more accessible not just the JS part of it |
😉 I think your work is actually quite awesome; it just isn't always so "tidy and clean". I guess that's the result of hacking away late in the night... 😃
Yes.
Feel free to experiment in that direction if you like. |
thanks and please dont stop beeing critical otherwise i will not improve. just dont get mad at me because i cant get over my biggish change handling that is just what im used to so i have to migrate my brain for the new process and that takes a while. |
@JanEggers, have you managed to do anything about this? I might be able to squeeze in a few CefSharp hours later tonight so just want to check status. This one I am more than willing to start jumping into, it's challenging and fun. 😄 |
not really i just added wrapper classes but i didnt commit them yet. and im at work now so ill try to submit a pr when at home. we have some timing issues to resolve i found out. the wcf proxy has to be created after the browser is created but before the oncontextcreated method is called. atm it is created on first call to javascriptevaluate thats definitly too late. update: at home ca now + 10 hours |
Alright. I might start looking into it now also while on the plane (boarding in a few minutes. 😄). I strongly suggest you make a WIP PR asap, and I can then use your code and build on top of it. |
I think I'll also finally start jumping on this again since I've been I'll spend some time tonight syncing my fork with latest master and getting // Sascha On Wed, Apr 2, 2014 at 7:08 AM, Per Lundberg notifications@gh.neting.ccwrote:
|
I've started looking into it the other day, but didn't get very far. Let's see if I can push up a feature branch with (some) of this stuff later today. I just feel sooo "not-used-to" C++ function pointers and all... I write too little C++ code these days, but I guess I should be more than happy with that. 😉 |
Js Binding merged into master, so closing. |
For the moment, Javascript bindings is missing from the CEF3 branch. We should fix it to work once again.
Blocks closing of #136.
The text was updated successfully, but these errors were encountered: