1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibWeb+WebContent: Add a simple API for running arbitrary JavaScript

This patch adds OutOfProcessWebView::run_javascript(StringView).
This can be used by the OOPWV embedder to execute arbitrary JavaScript
in the top-level browsing context on the WebContent process side.
This commit is contained in:
Andreas Kling 2021-08-24 16:56:42 +02:00
parent 6b2aadce11
commit fd922cf92f
5 changed files with 27 additions and 0 deletions

View file

@ -412,6 +412,11 @@ void OutOfProcessWebView::js_console_input(const String& js_source)
client().async_js_console_input(js_source);
}
void OutOfProcessWebView::run_javascript(StringView js_source)
{
client().async_run_javascript(js_source);
}
String OutOfProcessWebView::selected_text()
{
return client().get_selected_text();

View file

@ -35,6 +35,8 @@ public:
void js_console_initialize();
void js_console_input(const String& js_source);
void run_javascript(StringView);
String selected_text();
void select_all();