It might be obvious, but I'm not seeing an easy way to determine the full height of a document after it has been rendered.
Additionally, is there a way to turn off scrollbars on the browser control?
Thanks,
Matt
matthewj wrote:It might be obvious, but I'm not seeing an easy way to determine the full height of a document after it has been rendered.
Additionally, is there a way to turn off scrollbars on the browser control?
matthewj wrote:JS is not ideal to get the height, but I should be able to execute it via CefFrame::ExecuteJavaScript. However, I don't see a good way to pass the result back to the caller.
matthewj wrote:Do I have to use the JS to update the DOM and then use the other APIs to look in the DOM to get the data?
cagret wrote:Marshall,
Would it be a problem to add a similar function to ExecuteJavascript() but with arguments like in ExecuteFunction()?
So I can call: frame->ExecuteFunction("alert", args, retval, exception);
Alert is not the best example, but when I want to pass data that I already have in some kind of format, using ExecuteJavascript is problematic cause I would need to stringify that data to json or something.
<head>
window.sendCallback("myfunc1", myfunc1);
window.sendCallback("myfunc2", myfunc2");
</head>
context = CefV8Context::GetCurrentContext();
jsfuncs = array(
"myfunc1" => (callback, context),
"myfunc2" => (callback, context)
)
// myfunc1 = arguments[0], callback = arguments[1]
callback = jsfuncs["myfunc1"][0]
context = jsfuncs["myfunc2"][1]
context.Enter()
callback->ExecuteFunctionWithContext(context, callback, someArguments, retval, exception);
SomeWork_1();
context.Exit()
SomeWork_2();
cagret wrote:And that code between .Enter() and .Exit() is executed asynchronously, so that if myfunc1() executes for 5 secs, then SomeWork_2() will be executed before SomeWork_1() ?
Is it also possible to execute myfunc1() synchronously? Or do I always need to call .Enter and .Exit?
I read more and seems like calling context.Enter and .Exit is required when creating V8 Objects, Arrays or Functions - and I can create them only asynchronously, is that right?
cagret wrote:You want to pass the height from javascript to c++?
You could use javascript handler binding, see cefclient.cpp: HandleJSBinding, binding_test.h, binding_test.cpp.
Users browsing this forum: No registered users and 199 guests