diff options
author | Barrucadu <mike@barrucadu.co.uk> | 2009-05-03 19:32:49 +0100 |
---|---|---|
committer | Barrucadu <mike@barrucadu.co.uk> | 2009-05-03 19:32:49 +0100 |
commit | 01cfcffd7762edd4bed94e91b2013890680765a9 (patch) | |
tree | 1c9269911972d6a71628a16732c055c18feae630 | |
parent | d0dfcc7ad664f4ff25ade28a38a2157ce4fda94d (diff) |
Added command "script" to run javascript on the current page.
-rw-r--r-- | CHECKLIST | 1 | ||||
-rw-r--r-- | examples/configs/sampleconfig | 2 | ||||
-rw-r--r-- | examples/configs/sampleconfig-dev | 1 | ||||
-rw-r--r-- | uzbl.c | 7 | ||||
-rw-r--r-- | uzbl.h | 3 |
5 files changed, 13 insertions, 1 deletions
@@ -34,3 +34,4 @@ Also testers and interested people can use this list to see what uzbl is about, * searching: /_ = search %s <-- hilight all ; = search <-- jump over all hits +* run javascript on curent page through "script" command.
\ No newline at end of file diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 6f4d8d9..e4fd3a6 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -50,7 +50,7 @@ B = spawn /usr/share/uzbl/examples/scripts/insert_bookmark.sh u = spawn /usr/share/uzbl/examples/scripts/load_url_from_history.sh U = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh ZZ = exit - +S = script alert("hi"); [network] proxy_server = diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 7e1e31d..7ce220f 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -50,6 +50,7 @@ B = spawn ./examples/scripts/insert_bookmark.sh u = spawn ./examples/scripts/load_url_from_history.sh U = spawn ./examples/scripts/load_url_from_bookmarks.sh ZZ = exit +S = script alert("hi"); [network] # to start a local socks server, do : ssh -fND localhost:8118 localhost @@ -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 }, @@ -375,6 +376,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')) { strcpy(searchtx, param); @@ -119,4 +119,7 @@ settings_init (); static void search_text (WebKitWebView *page, const char *param); +static void +run_js (WebKitWebView * web_view, const gchar *param); + /* vi: set et ts=4: */ |