[Webkit-unassigned] [Bug 245059] Web extensions doesn't work
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 13 07:44:29 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=245059
Michael Catanzaro <mcatanzaro at gnome.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #7 from Michael Catanzaro <mcatanzaro at gnome.org> ---
Ah, your example program is a blast from the past....
(In reply to Ashu Sharma from comment #4)
> Sorry, I can't provide my source code, But that is just simple, i have
> attached a working "webext example", i connects through dbus in same way as
> done in "example program", but my application just opens multiple windows
> with different instances of webkit.Webcontext in each window as i said
> earlier.
Without an example that reproduces the bug, I'm afraid my guess is you're doing something wrong. :P Based on the example that you attached, I'm actually a little more confident of this.
> Whatever, I just need to do following:
> 1. Add/Modify/Remove element from DOM
> 2. Receive each mouse/key events from WebKit
> 3. Set custom "window['CUSTOM']" in javascript. (like window['chrome'] etc)
> 4. Even if possible call app function by calling javascript method:
>
> I have heard about "JavascriptCoreGtk", does it can do above?
I think you can do all of this using webkit_web_view_run_javascript().
> As i know the current way, it all working well with 1-2 windows, fewtimes
> even with multiple windows.
> You can use use messages api instead of custom DBus for the process communication. See https://webkitgtk.org/reference/webkit2gtk/stable/WebKitUserMessage.html
This would indeed be easier than using D-Bus. The example that you attached was written before the messages API existed. Another issue with that example is it is using the session bus instead of a private connection. But most importantly, it's using a fixed address. Even if you were using a single web extension -- which you're not, because you mentioned you were multiple web contexts -- you would still need to use a different address for each web process. Unless you show how your code handles that, we'll need to assume there's a bug on your end.
Using the message passing API would allow you to ignore those considerations. But since the risk is high that it will go away in the future, I would probably try to stick to the UI process if you can, and see if you can do everything using webkit_web_view_run_javascript(). It might not be possible, but if you can, then you don't need to worry about it breaking in the future.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220913/81a0a632/attachment.htm>
More information about the webkit-unassigned
mailing list