[wpe-webkit] Synchronous JS interactions with native code
munezbn.dev at gmail.com
Mon Jun 24 22:54:23 PDT 2019
I am not sure if it is really helpful , but i was looking something
similar  and then after getting all help from folks here, I wrote a
sample web-extension using JSC Glib API which you can find at  .
If you want to learn more about web extension then refer  and for
understanding JSC Glib API refer 
Thanks & Regards
On Tue, Jun 25, 2019 at 5:51 AM Ryan Walklin <ryan at testtoast.com> wrote:
> Hi All,
> I'm currently experimenting with implementing a basic subset of the
> WebExtension API (
> with WPE, and struggling with some basics. This may be due to my poor
> knowledge of JS, or sheer impossibility, but I'd love some help.
> I know that Midori has a stub implementation using WebKitGTK (
> https://github.com/midori-browser/core/pull/250) and they use a
> combination of webkit_user_content_manager_register_script_message_handler
> to register a script handler, then in JS call
> window.webkit.messageHandlers.midori.postMessage to get back to UI code,
> "Promise.resolve()" to execute the callback.
> So far they have implemented functions that themselves return promises,
> however I need to implement APIs to directly return function results and
> variables, e.g. browser.runtime.getManifest() that returns the
> WebExtension's manifest.json file. I've tried to modify Midori's JS
> function to use async/await to return the value once the promise resolves,
> but have had no success so far.
> Has anyone else tried anything like this? Or is there any way to have
> synchronous communication between the JS context and my app?
> Do not post admin requests to the list. They will be ignored.
> webkit-wpe mailing list (webkit-wpe at lists.webkit.org)
> Help/Unsubscribe/Update your Subscription:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-wpe