I have a project that is mimicking a small subset of the Puppeteer API. I am looking for a way to call an existing JS function within a window/frame. Essentialy I am trying to duplicate this https://pptr.dev/api/puppeteer.page.evaluate. I see there is the Eval function on the CefV8Context, but that appears to simply evaluate JS in the string parameter. Please correct me if I am wrong here. Essentially I would like to do the following.
Given this JS function in a frame/page
- Code: Select all
function someFunc({
...
}) {...}
Call the function from the render process
- Code: Select all
context->Eval("someFunc", args, ...);
As an alternative I do see I could modify the page to register the function with the render process per the docs: https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md#markdown-header-executing-functions.
I am wondering if what I am trying to do is possible with CEF. Thanks for any Help.