From d8728e61b587e80efe30f0fc198ed195b8067b3e Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Sat, 2 May 2009 23:27:15 +0100 Subject: Added no_fifo and no_socket variables to config file. --- examples/configs/sampleconfig | 2 ++ examples/configs/sampleconfig-dev | 2 ++ 2 files changed, 4 insertions(+) (limited to 'examples') diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 3fddc89..61ab373 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -19,6 +19,8 @@ always_insert_mode = 0 modkey = Mod1 show_status = 1 status_top = 0 +no_fifo = 0 +no_socket = 0 [bindings] # scroll down/up/left/right diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index b151e92..c339c07 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -19,6 +19,8 @@ always_insert_mode = 0 modkey = Mod1 show_status = 1 status_top = 0 +no_fifo = 0 +no_socket = 0 [bindings] ## scroll down/up/left/right -- cgit v1.2.3 From 8f9c1fbc0aa1cf4f848c859573b71390b058f5af Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Sun, 3 May 2009 12:28:02 +0100 Subject: Removed no_fifo and no_socket variables. --- examples/configs/sampleconfig | 2 -- examples/configs/sampleconfig-dev | 2 -- uzbl.c | 18 ++++++------------ 3 files changed, 6 insertions(+), 16 deletions(-) (limited to 'examples') diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 61ab373..3fddc89 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -19,8 +19,6 @@ always_insert_mode = 0 modkey = Mod1 show_status = 1 status_top = 0 -no_fifo = 0 -no_socket = 0 [bindings] # scroll down/up/left/right diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index c339c07..b151e92 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -19,8 +19,6 @@ always_insert_mode = 0 modkey = Mod1 show_status = 1 status_top = 0 -no_fifo = 0 -no_socket = 0 [bindings] ## scroll down/up/left/right diff --git a/uzbl.c b/uzbl.c index debef04..1730377 100644 --- a/uzbl.c +++ b/uzbl.c @@ -90,8 +90,6 @@ static gboolean status_top = FALSE; static gchar* modkey = NULL; static guint modmask = 0; static guint http_debug = 0; -static gboolean no_fifo = FALSE; -static gboolean no_socket = FALSE; /* settings from config: group bindings, key -> action */ static GHashTable* bindings; @@ -873,20 +871,16 @@ settings_init () { if (! socket_dir) socket_dir = g_key_file_get_value (config, "behavior", "socket_dir", NULL); keys = g_key_file_get_keys (config, "bindings", NULL, NULL); - no_fifo = g_key_file_get_boolean (config, "behavior", "no_fifo", NULL); - no_socket = g_key_file_get_boolean (config, "behavior", "no_socket", NULL); } printf ("History handler: %s\n", (history_handler ? history_handler : "disabled")); printf ("Download manager: %s\n", (download_handler ? download_handler : "disabled")); - printf ("Fifo directory: %s\n", (fifo_dir ? fifo_dir : "/tmp")); - printf ("Socket directory: %s\n", (socket_dir ? socket_dir : "/tmp")); + printf ("Fifo directory: %s\n", (fifo_dir ? fifo_dir : "disabled")); + printf ("Socket directory: %s\n", (socket_dir ? socket_dir : "disabled")); printf ("Always insert mode: %s\n", (always_insert_mode ? "TRUE" : "FALSE")); printf ("Show status: %s\n", (show_status ? "TRUE" : "FALSE")); printf ("Status top: %s\n", (status_top ? "TRUE" : "FALSE")); printf ("Modkey: %s\n", (modkey ? modkey : "disabled")); - printf ("FIFO: %s\n", (no_fifo ? "disabled" : "enabled")); - printf ("Socket: %s\n", (no_socket ? "disabled" : "enabled")); if (! modkey) modkey = ""; @@ -1019,18 +1013,18 @@ main (int argc, char* argv[]) { if (!show_status) gtk_widget_hide(mainbar); - if (!no_fifo) + if (fifo_dir) create_fifo (); - if (!no_socket) + if (socket_dir) create_socket(); gtk_main (); g_string_free(keycmd, TRUE); - if (!no_fifo) + if (fifo_dir) unlink (fifo_path); - if (!no_socket) + if (socket_dir) unlink (socket_path); g_hash_table_destroy(bindings); -- cgit v1.2.3 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. --- CHECKLIST | 1 + examples/configs/sampleconfig | 2 +- examples/configs/sampleconfig-dev | 1 + uzbl.c | 7 +++++++ uzbl.h | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/CHECKLIST b/CHECKLIST index 9a9bfbf..66f7bf6 100644 --- a/CHECKLIST +++ b/CHECKLIST @@ -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 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')) { diff --git a/uzbl.h b/uzbl.h index f9e3053..f81e3f6 100644 --- a/uzbl.h +++ b/uzbl.h @@ -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: */ -- cgit v1.2.3