-
Notifications
You must be signed in to change notification settings - Fork 51
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
Javascript binding integration #17
Comments
Thanks yes this is on our list for the future. Can you describe how you intend to use it? Of the various native-object-injection-like features you've listed above or tried out, does any aspects of those features jump out as particularly good or bad? |
There are complexities with each one of them mainly around the fact that the browser engines use multiple processes. WebKitGTK was a bit more complicated because it required the use of a separate extension "DLL", but we were able to overcome that by making the executable also export the functions for the extension. Some earlier versions of WebKitGTK didn't require this so we have two ways. Preferably we don't want to have to implement a separate extension DLL. JavascriptCoreGTK is a really simple library to use when implementing with it. I don't think the method we used by IWebBrowser2 was particularly good because it required us to wait for the document to complete loading before registering the invoker. Although it did allow us to only register it on certain pages, but we aren't loading anything we don't control. Apple WebKit I believe was simplified due to features (selectors, etc) of the Objective C language. Probably the best solution is to continue to use IDispatchEx in some form or another since you are already using COM interfaces but perhaps don't require us to register it after the page is complete. |
+1 |
Hey all. Happy to report that we just shipped native object injection support in 0.8.314. Closing the issue for now and feel free to re-open the issue and let us know if you have additional feedback. |
This might already be in the works, but I think there should be a deeper way to integrate with the javascript engine. I realize that you already have the postMessage functionality and the ability to insert a javascript snippet before the document loads.
CEF allows for javascript integration with the v8 javascript engine using the CefRegisterExtension function.
Apple WebKit allows for modifying the script environment using the windowScriptObject.
In IE/Trident it is possible through IDispatchEx after the document is done loading.
WebKitGTK allows for manipulation of the javascript context and ability to call from javascript functions to native code through the use of extensions for version 2 and a signal in earlier versions pre-multi-process.
The text was updated successfully, but these errors were encountered: