[Webkit-unassigned] [Bug 241420] [WPE][GTK] Drop _in_world variants of run_javascript APIs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 1 02:38:02 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=241420

Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cgarcia at igalia.com

--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Michael Catanzaro from comment #1)
> Should also split the script argument into:
> 
>   @body: the JavaScript function body
>   @arguments: a #GHashTable storing the function arguments
> 
> to match webkit_web_view_run_async_javascript_function_in_world() added in
> https://github.com/WebKit/WebKit/pull/1378.

That only makes sense when calling a function. I'm not sure we want a function for everything with optional parameters, so at least I would keep two, once for evaluating a script and another for calling a function. Maybe we can indeed use "evaluate" and "call" instead of "run" (matching cocoa api) and deprecate the run methods, which would simplify the ifdefs logic and api documentation. The equivalent to what we currently have would be:

void webkit_web_view_evaluate_javascript(WebKitWebView* webView, const char* script, const char* worldName, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData)

void webkit_web_view_call_async_javascript_function(WebKitWebView* webView, const char* body, GVariant* arguments, const char* worldName, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData)

I don't know what to do with webkit_web_view_run_javascript_from_gresource(). It doesn't have the in_world variant, nor the async functiona call. I think we can just remove it from the new API, callers can read the resource first and then use evaluate or call.

-- 
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/20230201/7c7d60d4/attachment.htm>


More information about the webkit-unassigned mailing list