]> git.sesse.net Git - nageru/blobdiff - cef_capture.cpp
Implement HTMLInput::execute_javascript_async().
[nageru] / cef_capture.cpp
index 9c4f68c8f6d875ea40a1e03b3d7b015b392efea0..1836eb88f9cf474b9cc5c4287b3b7c011f39ac4c 100644 (file)
@@ -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("<theme eval>");
+               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();