V8 of nodejs and V8 of chronium (libcef) must be exactly the same this is because the reason appjs can directly access objects in the browser window is that the two v8 are merged and share the same thread and event loop. If they have different versions then build will fail.
I am not sure exactly where the architecture is described but I believe I started by reading the first messages on the dev mailing list. If you search for "bridge" and read the discussion around that. You are very welcome to create a wiki page on github and add what you find as more people would be interested in the answer. I did not build the bridge code so dont want to answer with inaccurate information.
Although i am still struggling with building appjs, i am thinking that the structure of appjs is like it executes node.exe with its own bindings_of_js that links with libcef for html and css rendering. But since CEF also uses V8 internally, would not they both be present at the run time ?Is there any documentation for the same for the newbies ?
--
You received this message because you are subscribed to the Google Groups "appjs-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appjs-dev+...@googlegroups.com.
To post to this group, send email to appj...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The general philosophy for appjs is to try to do as much as possible without forking chromium or nodejs. Therefore my understanding is that the cef binaries are pure, but someone else with knowledge needs to answer this question.
If you poke around a little in the source code you will notice that a lot of it is in pure javascript. I found that out when writing a new handler for appjs. You can even find a bridge file in javascript - I dont know the split between javascript and C++ but a lot is accomplished with javascript hence reducing need to fork and maintain special code base.
Thanks for the response. For some days i looked into bridge.js and found that [ actually i think that the following is what is happening, so if you find that something is wrong, please clarify ]1. bridge.js runs in both the browser [libcef] and in node. It sends browser-require.js to browser. Q. Are their any other file that is also available to browser ?2. bridge.js adds nativeWindow.onmessage and in LibCef it adds appjs.onmessage.3. The flow of data is like this:Mirror pipe.send cpp in Window::oncontextcreateed bridge.jsFrom node side -> whoever calls pipe.send -> nativeWindow.send -> LibCEf Window::sendSync -> every context had appjs -> get its onmessage() and make a call to it and sends the data.=> onmessag() of appjs browser side invokes the "mirror" operation for that msg.key which wraps something based on that key and onmessage then encode or stringify it and returns back. to nativeWindow.send where it is decoded or JSON.parsed.From browser side -> appjs.send() calls AppjsSyncHandler::Execute() and that takes the window handle and calls the onmessage() on it. => nativeWindow.onmessage() and hence data is passed to node.4. Localids are those which other side has asked for and i am sending it information about it. These are my things. Similarly, foreignIds are what i have asked from the other side.5. There is no WebSocket communication heppening.6. when i do var fs = window.require('fs'); fs.readFile( window.__dirname + "/content/hello.txt", function(data){ alert(data); } );This could call the browser-require.js's window.require.The readFile function is loaded at node side and stored in proxy. Then parameters are passed. Communication happens between both sides about the kind of parameters like object or function or literal etc.The result is send back.