Thanks, loading scripts with webkit_user_content_manager_add_script() works, but it seems like cannot hold values for global javascript variables. Did somebody experienced this issue? Thanks
Adrian Perez de Castro <ape...@igalia.com> ezt írta (időpont: 2019. márc. 5., K, 15:42): > Hello Daniel, > > On Tue, 5 Mar 2019 14:22:23 +0100, Daniel Berek <berekdan...@gmail.com> > 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 >
_______________________________________________ webkit-gtk mailing list webkit-gtk@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-gtk