From 01cfcffd7762edd4bed94e91b2013890680765a9 Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Sun, 3 May 2009 19:32:49 +0100 Subject: Added command "script" to run javascript on the current page. --- uzbl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index 2f24b56..edd0b38 100644 --- a/uzbl.c +++ b/uzbl.c @@ -303,6 +303,7 @@ static struct {char *name; Command command;} cmdlist[] = { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?). { "zoom_out", view_zoom_out, }, { "uri", load_uri }, + { "script", run_js }, { "toggle_status", toggle_status_cb }, { "spawn", spawn }, { "exit", close_uzbl }, @@ -374,6 +375,12 @@ load_uri (WebKitWebView * web_view, const gchar *param) { } } +static void +run_js (WebKitWebView * web_view, const gchar *param) { + if (param) + webkit_web_view_execute_script (web_view, param); +} + static void search_text (WebKitWebView *page, const char *param) { if ((param) && (param[0] != '\0')) { -- cgit v1.2.3