summaryrefslogtreecommitdiffstats
path: root/.conkerorrc
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-09-13 02:43:47 +0200
committerGravatar Tom Willemsen2012-09-13 02:43:47 +0200
commit5a36f207f6529b072742da9c42d95eee25b1fae0 (patch)
tree45db8f6bfccd7c656cd20d30d02b9fc88ae16307 /.conkerorrc
parent0228c95a0b433216382334194852fb0e70da82ff (diff)
downloaddotfiles-5a36f207f6529b072742da9c42d95eee25b1fae0.tar.gz
dotfiles-5a36f207f6529b072742da9c42d95eee25b1fae0.zip
.conkerorrc/init.js
Diffstat (limited to '.conkerorrc')
-rw-r--r--.conkerorrc/init.js18
1 files 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));