// -*- mode: espresso; -*- // o------------------o // | CONKEROR CONFIG | // o------------------o // o--------------------------------------------------------o // | USEFUL SITES: | // | | // | http://home.michaelzeller.com/tips/conkeror/index.html | // o--------------------------------------------------------o // Load Modules //----------------------------------------- // Open links in a new buffer (foreground) require("clicks-in-new-buffer.js"); // Enable tabs //require("tab-bar.js"); require("new-tabs.js"); // (Uses CSS (see chrome)) //--------------------------------END // Settings //--------------------------------- // cwd (set default download directory) cwd=get_home_directory(); cwd.append("downloads"); // No new window for downloads download_buffer_automatic_open_target=OPEN_NEW_BUFFER; // Don't open download buffer automatically //remove_hook("download_added_hook", open_download_buffer_automatically); // Reload this file on the fly interactive("rc-reload", "Reload the Conkerorrc.", function(I) { load_rc_file("/usr/home/purgatori/.conkerorrc"); }); // Open external links in new buffer (for Emacs) url_remoting_fn = load_url_in_new_buffer; // Use emacsclient as external editor editor_shell_command = "emacsclient -c" // Clear history after 1 day session_pref('browser.history_expire_days', 1); // Reduce memory consumption session_pref('browser.cache.memory.capacity', 4096); session_pref('browser.cache.memory.enable', false); // Reduce amount of time Firefox stores uncompressed images in memory session_pref('mage.mem.min_discard_timeout_ms', 100000); // Clear downloads history on completion session_pref('browser.download.manager.retention', 0); // Start page homepage = "/home/purgatori/.w3m/bookmark.html"; // Some hacks to stop focus-stealing JS shit: http://conkeror.org/Focus //Hack #1: broken //Hack #2 function focusblock (buffer) { var s = Components.utils.Sandbox(buffer.top_frame); s.document = buffer.document.wrappedJSObject; Components.utils.evalInSandbox( "(function () {\ function nothing () {}\ if (! document.forms)\ return;\ for (var i = 0, nforms = document.forms.length; i < nforms; i++) {\ for (var j = 0, nels = document.forms[i].elements.length; j < nels; j++)\ document.forms[i].elements[j].focus = nothing;\ }\ })();", s); } add_hook('content_buffer_progress_change_hook', focusblock); //----------------END // Web-Jumps //----------------------- define_webjump("imdb", "http://m.imdb.com/find?q=%s"); //IMDB Mobile define_webjump("b", "http://blekko.com/ws/%s", $alternative = "http://blekko.com/"); //Blekko define_webjump("bi", "http://blekko.com/ws/%s/images"); //Blekko Image Search define_webjump("ix", "http://ixquick.com/do/metasearch.pl?query=%s"); //IxQuick define_webjump("wa", "http://www.wolframalpha.com/input/?i=%s"); //WolframAlpha define_webjump("y", "http://www.youtube.com/results?search_query=%s&search=Search"); //Youtube define_webjump("d", "http://duckduckgo.com/?q=%s"); //DuckDuckGo define_webjump("zb", "javascript:(function(){var%20e=document.getElementsByTagName('body')[0].setAttribute('style','background-image:none;');})()"); define_webjump("tv", "http://thetvdb.com/?string=%s&searchseriesid=&tab=listseries&function=Search"); //TV Database define_webjump("mv", "http://www.themoviedb.org/search?query=%s"); //Movie Database define_webjump("bin", "http://www.bing.com/images/search?q=%s"); //Bing Image Search //----------------------END // Styling //------------------------ //register_user_stylesheet( // "data:text/css,"+ // escape("#minibuffer, tree.completions, .mode-line { font-family: Inconsolata; font-size: 12pt; }")); interactive("toggle-stylesheets", "Toggle whether conkeror uses style sheets (CSS) for the " + "current buffer. It is sometimes useful to turn off style " + "sheets when the web site makes obnoxious choices.", function(I) { var s = I.buffer.document.styleSheets; for (var i = 0; i < s.length; i++) s[i].disabled = !s[i].disabled; }); //Big Hint Numbers register_user_stylesheet( "data:text/css," + escape( "@namespace url(\"http://www.w3.org/1999/xhtml\");\n" + "span.__conkeror_hint {\n"+ " font-size: 14px !important;\n"+ " line-height: 14px !important;\n"+ "}")); //---------------------END // Keybindings //------------------------ define_key(default_global_keymap, "C-x C-m", "execute-extended-command"); //Unfocus input fields define_key(content_buffer_normal_keymap, "M-q", "unfocus"); //Follow new link in background buffer define_key(content_buffer_normal_keymap, "d", "follow-new-buffer-background"); //----------------------END // Broken/Deprecated //--------------------------- // modeline require("mode-line.js"); // Funky icons in the modeline // load session module require("session.js"); // auto-load session session_auto_save_auto_load = true; // Enable favicon support //require("favicon"); // favicons hook //add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true); //add_hook("mode_line_hook", mode_line_adder(loading_count_widget), true); //add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true); //---------------------------END