[Webkit-unassigned] [Bug 204880] Automation: scripts are executed in the wrong js context after a history navigation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 7 08:35:49 PST 2020
https://bugs.webkit.org/show_bug.cgi?id=204880
--- Comment #6 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 384891
--> https://bugs.webkit.org/attachment.cgi?id=384891
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=384891&action=review
>> Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp:195
>> + JSObjectRef automationSessionProxy = JSObjectCallAsConstructor(context, const_cast<JSObjectRef>(automationSessionProxyConstructor), WTF_ARRAY_LENGTH(arguments), arguments, &exception);
>
> Why not do this in the script itself and avoid having to call all of this API? That way, you could invert this entire function and make it such that if `if (!JSObjectHasProperty(context, globalObject, webkitAutomationName.get()))` all you have to do is just evaluate the script, and then the rest of the logic to get the `automationSessionProxy` instance could be the same.
The thing is that we need to provide the constructor arguments from C++ implementation. If we always call the script we would be creating the js values every time, but they are only needed the first time.
--
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/20200107/9e8d7200/attachment.htm>
More information about the webkit-unassigned
mailing list