On Wed, Sep 13, 2017 at 12:15 PM, Adrian Perez de Castro <[email protected]> wrote:
> On Wed, 13 Sep 2017 17:55:20 +0200, Jérémy Lal <[email protected]> wrote: > > Also it's simpler to setup a limited javascript -> main process event > > listener using a "script message handler". > > I was about to mention this :-) > > For the opposite direction (Main process -> JavaScript), you can use > webkit_web_view_run_javascript() and call code in the JS world: > > https://webkitgtk.org/reference/webkit2gtk/stable/ > WebKitWebView.html#webkit-web-view-run-javascript Note, this callback does not provide a return value back to javascript. It is useful if no return value is needed. If return value is needed, the webextension route has to be taken > > > As a complement to the above, if you need to add extra glue code to the JS > world that is not included in your loaded web content, you can use > webkit_user_content_manager_add_script() to inject JS code from the main > process: > > https://webkitgtk.org/reference/webkit2gtk/stable/ > WebKitUserContentManager.html#webkit-user-content-manager-add-script > > Hope this helps! > > > -- > Adrián 🎩 > > -- Leo Ufimtsev, Software Engineer, Red Hat
_______________________________________________ webkit-gtk mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-gtk
