Hello Daniel, On Tue, 5 Mar 2019 14:22:23 +0100, Daniel Berek <[email protected]> wrote:
> Hi, one more question, u mentioned that at the and I have to use the
> “user-content-manager” property [3].
> Do you have any examples or tutorials for that, or is my implementation
> enough?
>
> WebKitUserContentManager *manager =
> webkit_web_view_get_user_content_manager(*this);
> g_signal_connect(manager,
> "script-message-received::buttonPressed",
> G_CALLBACK(button_pressed_received_cb),
> this);
> WebKitUserScript* script =
> webkit_user_script_new("file:///home/pi/gui/script.js",
> WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
> WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, nullptr, nullptr);
> webkit_user_content_manager_add_script(manager, script);
> webkit_user_script_unref(script);
Yes, using the WebKitUserContentManager that is created by default, which
you are obtaining with “webkit_web_view_get_user_content_manager()” in your
sample code 👍
Cheers,
-Adrián
pgpvhXL7n4h88.pgp
Description: PGP signature
_______________________________________________ webkit-gtk mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-gtk
