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));