X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=cef_capture.cpp;fp=cef_capture.cpp;h=1836eb88f9cf474b9cc5c4287b3b7c011f39ac4c;hp=9c4f68c8f6d875ea40a1e03b3d7b015b392efea0;hb=f7fba578a1f5e2ef2b0ede1ac058b3fdb95ab4b1;hpb=f1ce3c5618f769b1388b39c637877d242c8ddeed diff --git a/cef_capture.cpp b/cef_capture.cpp index 9c4f68c..1836eb8 100644 --- a/cef_capture.cpp +++ b/cef_capture.cpp @@ -71,6 +71,15 @@ void CEFCapture::set_max_fps(int max_fps) }); } +void CEFCapture::execute_javascript_async(const string &js) +{ + post_to_cef_ui_thread([this, js] { + CefString script_url(""); + int start_line = 1; + browser->GetMainFrame()->ExecuteJavaScript(js, script_url, start_line); + }); +} + void CEFCapture::OnPaint(const void *buffer, int width, int height) { steady_clock::time_point timestamp = steady_clock::now();