You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create this issue to list current IPC techniques so we don't have to search in the codebase back and forth. And at the same time looking for possible improvement. Because some are blocked by upstream, some are platform-specific solutions, and some could be done already since it's just caused by serialization overhead.
evaluate_script
evaluate_script is an API to run a javascript code for the page. #474 demonstrates current implementation and possible improvement pretty well already.
We could add the callback closure to do some stuff after javascript result. But this still has to serialize into strings. So it remains as a good-to-have feature for me, and I didn't have much time to implement this before.
ipc_handler / postMessage
ipc_handler takes a closure that can be called when javascript call window.ipc.postMessage("insert_message_here");. This only accepts string as parameter. We usually use evaluate_script to return the value but this is also string only.
For parameters, mac and Linux can take different JSValue rather than only strings. But windows can only work receive as string.
For return values, please see the first comment of #454. Mac and Windows have some API to add native objects. We can treat these as return values. Linux doesn't provide such functionality, but in the generated wrapper, run_javascript's callback is called after run_javascript_finish. Perhaps we can write another one with callback first and it creates a JS value, then we call run_javascript_finish with that result value.
custom_protocol / custom URL scheme
custom_protocol is a customized URL handler that work like HTTP. It can receive an HTTP request and return an HTTP response without any remote server. The problem is it's still a little different from ordinary HTTP and sometimes it has subtle issues like secure cookie doesn't work on some platforms etc.
In #667, @JonasKruckenberg tried to evaluate streaming possibility, but on Linux, it's blocked by #666. On Linux, the request of custom protocol can't access body for now.
Others
Webview2 has a specific API for shared buffer. But this seems like webview2 only.
The text was updated successfully, but these errors were encountered:
Adrián Pérez wrote a great post about IPC approach around WPE which also apply to WebkitGTK.
Nothing new method for us, but I feel like there are a few further ideas worth exploring. https://wpewebkit.org/blog/06-integrating-wpe.html
I would like to create this issue to list current IPC techniques so we don't have to search in the codebase back and forth. And at the same time looking for possible improvement. Because some are blocked by upstream, some are platform-specific solutions, and some could be done already since it's just caused by serialization overhead.
evaluate_script
evaluate_script
is an API to run a javascript code for the page. #474 demonstrates current implementation and possible improvement pretty well already.We could add the callback closure to do some stuff after javascript result. But this still has to serialize into strings. So it remains as a good-to-have feature for me, and I didn't have much time to implement this before.
ipc_handler
/postMessage
ipc_handler
takes a closure that can be called when javascript callwindow.ipc.postMessage("insert_message_here");
. This only accepts string as parameter. We usually useevaluate_script
to return the value but this is also string only.For parameters, mac and Linux can take different JSValue rather than only strings. But windows can only work receive as string.
For return values, please see the first comment of #454. Mac and Windows have some API to add native objects. We can treat these as return values. Linux doesn't provide such functionality, but in the generated wrapper,
run_javascript
's callback is called afterrun_javascript_finish
. Perhaps we can write another one with callback first and it creates a JS value, then we callrun_javascript_finish
with that result value.custom_protocol
/ custom URL schemecustom_protocol
is a customized URL handler that work like HTTP. It can receive an HTTP request and return an HTTP response without any remote server. The problem is it's still a little different from ordinary HTTP and sometimes it has subtle issues like secure cookie doesn't work on some platforms etc.In #667, @JonasKruckenberg tried to evaluate streaming possibility, but on Linux, it's blocked by #666. On Linux, the request of custom protocol can't access body for now.
Others
Webview2 has a specific API for shared buffer. But this seems like webview2 only.
The text was updated successfully, but these errors were encountered: