From 5a36f207f6529b072742da9c42d95eee25b1fae0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 13 Sep 2012 02:43:47 +0200 Subject: .conkerorrc/init.js --- .conkerorrc/init.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 1639c1e..438f402 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -1,3 +1,4 @@ +require("content-policy.js"); require("favicon"); theme_load_paths.push("/home/slash/.conkerorrc/themes/"); @@ -23,6 +24,17 @@ function oni_before_quit_func() { yield co_return(result); } +function oni_block_flash(content_type, content_location) { + var Y = content_policy_accept, N = content_policy_reject; + var action = ({ "youtube.com": Y } + [content_location.host] || N); + + if (action == N) + dumpln("blocked flash: " + content_location.spec); + + return action; +} + function oni_escape(str) { return str.replace(/(["$`])/g, '\\$1'); } @@ -130,10 +142,11 @@ define_webjump("arch/packages", "https://www.archlinux.org/packages/?sort=&q=%s&limit=50", $alternative="https://packages.archlinux.org"); +content_policy_bytype_table.object = oni_block_flash; cwd = make_file("/home/slash/downloads/"); -url_remoting_fn = load_url_in_new_buffer; -read_buffer_show_icons = true; hint_digits = "arstdhneio"; +read_buffer_show_icons = true; +url_remoting_fn = load_url_in_new_buffer; define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer"); @@ -142,6 +155,7 @@ define_key(content_buffer_normal_keymap, "H", define_key(default_base_keymap, "C-x f", "follow-new-buffer"); add_hook("before_quit_hook", oni_before_quit_func); +add_hook("content_policy_hook", content_policy_bytype); add_hook("mode_line_hook", mode_line_adder(buffer_count_widget, true)); add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget, true)); add_hook("mode_line_hook", mode_line_adder(downloads_status_widget)); -- cgit v1.2.3-54-g00ecf