On Fri, 27 Apr 2018 09:51:39 -0400, Anthony Walter <sys...@gmail.com> wrote: > I know webkitgtk version 1 is old and deprecated, but for the purposes of > supporting gtk2, I want to know if there exists a hook or connection > between a webview widget and libjavascriptcoregtk-1.0-0? > > For example, in webkit2gtk there exists the function: > > webkit_frame_get_javascript_global_context > > Which I assume allows you to access the javascript engine for a page and do > things like define classes and functions in native code that a web page > inside a webview could access and invoke.
Yes, that is exactly what you need. WebKitGTK+ historically did not provide an API for JavaScriptCore, but it exports the same C API that is available in other WebKit ports—so for example you should be able to reuse documentation and most code from examples you can find for MacOS. For a good starting point, you could use this tutorial: https://karhm.com/JavaScriptCore_C_API/ Unfortunately Apple has retired the documentation for the JavaScriptCore C API from developer.appple.com (they only have the Swift and Objective-C APIs) there now. You can still read the JavaScriptCore C API headers installed alongside the WebKitGTK+ ones; once you get a grasp of the basics they are reasonably easy to follow. I hope this helps. Best regards, -- Adrián 🎩
pgpBMV6w4vY3d.pgp
Description: PGP signature
_______________________________________________ webkit-gtk mailing list webkit-gtk@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-gtk