diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-03 22:14:49 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-03 22:14:49 +0200 |
commit | 4bd6b3f412ddf7af16cd96a638a9056f9b9ef336 (patch) | |
tree | 981a9a66a1b4546d4814aa7410b0afa4c5883c87 | |
parent | 4642ed19bcd60ac7ebb88ac99cac701defd62e64 (diff) | |
parent | 01cfcffd7762edd4bed94e91b2013890680765a9 (diff) |
merged in Barrucadus stuff
-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 | 58 | ||||
-rw-r--r-- | uzbl.h | 3 |
5 files changed, 40 insertions, 25 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 8d7aa08..f60e459 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 2a1bb51..25f66be 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 @@ -304,6 +304,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 }, @@ -376,6 +377,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); @@ -470,24 +477,23 @@ build_stream_name(int type) { xwin_str = itos((int)xwin); switch(type) { - case FIFO: - if (fifo_dir) - sprintf (fifo_path, "%s/uzbl_fifo_%s", fifo_dir, - instance_name ? instance_name : xwin_str); - else - sprintf (fifo_path, "/tmp/uzbl_fifo_%s", - instance_name ? instance_name : xwin_str); - break; - case SOCKET: - if (socket_dir) - sprintf (socket_path, "%s/uzbl_socket_%s", socket_dir, - instance_name ? instance_name : xwin_str); - else - sprintf (socket_path, "/tmp/uzbl_socket_%s", - instance_name ? instance_name : xwin_str); - break; - default: - break; + case FIFO: + if (fifo_dir) { + sprintf (fifo_path, "%s/uzbl_fifo_%s", fifo_dir, instance_name ? instance_name : xwin_str); + } else { + sprintf (fifo_path, "/tmp/uzbl_fifo_%s", instance_name ? instance_name : xwin_str); + } + break; + + case SOCKET: + if (socket_dir) { + sprintf (socket_path, "%s/uzbl_socket_%s", socket_dir, instance_name ? instance_name : xwin_str); + } else { + sprintf (socket_path, "/tmp/uzbl_socket_%s", instance_name ? instance_name : xwin_str); + } + break; + default: + break; } g_free(xwin_str); } @@ -893,8 +899,8 @@ settings_init () { 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")); @@ -1031,15 +1037,19 @@ main (int argc, char* argv[]) { if (!show_status) gtk_widget_hide(mainbar); - create_fifo (); - create_socket(); + if (fifo_dir) + create_fifo (); + if (socket_dir) + create_socket(); gtk_main (); g_string_free(keycmd, TRUE); - unlink (socket_path); - unlink (fifo_path); + if (fifo_dir) + unlink (fifo_path); + if (socket_dir) + unlink (socket_path); g_hash_table_destroy(bindings); g_hash_table_destroy(commands); @@ -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: */ |