[Webkit-unassigned] [Bug 186192] [GTK][WPE] Add API to run javascript from a WebKitWebView in an isolated world

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 3 03:09:07 PDT 2018


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

--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 341754
  --> https://bugs.webkit.org/attachment.cgi?id=341754
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341754&action=review

>> Source/WebCore/bindings/js/ScriptController.h:93
>> +    WEBCORE_EXPORT JSC::JSValue executeScriptInWorld(DOMWrapperWorld&, const String& script, bool forceUserGesture = false, ExceptionDetails* = nullptr);
> 
> ExceptionDetails* is OK, but const std::optional<ExceptionDetails>& would be better, right?

evaluateInworld expects ExceptionDetails*

>> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:3412
>> + * If WebKitSettings:enable-javascript is FALSE, this method will do nothing.
> 
> Currently, but we might want to change the behavior in the future, right? Because API users probably always want it to work regardless of the enable-javascript setting. Documenting that the functionality could change in the future might be useful. I see that you copied it from the webkit_web_view_run_javascript() docs, though.

Yes, we'll see how we can do that.

>> Source/WebKit/UIProcess/API/gtk/WebKitWebView.h:450
>> +                                                      const gchar               *world_name,
> 
> Why is using a name better than using a WebKitScriptWorld here? I guess the WebKitScriptWorld is a web process type, so that's probably not possible?

Right, WebKitScriptWorld creates an InjectedBundleScriptWorld, only available in the WebProcess.

>> Source/WebKit/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:45
>> +    static InjectedBundleScriptWorld* find(const String&);
> 
> This could be std::optional<InjectedBundleScriptWorld>. The point of std::optional is that we don't need to use a raw pointer for optional results anymore.

We don't want any copy here.

-- 
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/20180603/f423cb47/attachment.html>


More information about the webkit-unassigned mailing list