homepage = "http://bbs.archlinux.org/index.php"; add_delicious_webjumps ("jasonwryan") require("new-tabs.js"); function disable_scrollars (buffer) { buffer.browser.contentWindow.scrollbars.visible = false; } add_hook ("content_buffer_location_change_hook", disable_scrollbars); define_webjump("arch", "http://bbs.archlinux.org"); define_webjump("wiki", "http://wiki.archlinux.org"); define_webjump("twitter", "http://twitter.com"); define_webjump("bitly", "http://bit.ly"); define_webjump("flickr", "http://flickr.com"); // Darken Page function darken_page (I) { var newSS, styles='* { background: black ! important; color: grey !important }' + ':link, :link * { color: #4986dd !important }' + ':visited, :visited * { color: #d75047 !important }'; var document = I.window.buffers.current.document; if (document.createStyleSheet) { document.createStyleSheet("javascript:'" + styles + "'"); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName("head")[0].appendChild(newSS); } } interactive("darken-page", "Darken the page in an attempt to save your eyes.", darken_page); define_key(content_buffer_normal_keymap, "C-d", "darken-page"); // Make the current page readable by removing clutter // http://lab.arc90.com/experiments/readability/ interactive("readability_arc90", "Readability is a simple tool that makes reading on the web more enjoyable by removing the clutter around what you are reading", function readability_arc90(I) { var document = I.window.buffers.current.document; _readability_readStyle=document.createElement('SCRIPT'); _readability_readStyle.text = 'var readStyle = style-newspaper;'; document.getElementsByTagName('head')[0].appendChild(_readability_readStyle); _readability_readSize=document.createElement('SCRIPT'); _readability_readSize.text = 'var readSize = size-medium;'; document.getElementsByTagName('head')[0].appendChild(_readability_readSize); _readability_readMargin=document.createElement('SCRIPT'); _readability_readMargin.text = 'var readMargin = margin-wide;'; document.getElementsByTagName('head')[0].appendChild(_readability_readMargin); _readability_script=document.createElement('SCRIPT'); _readability_script.type='text/javascript'; _readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random()); document.getElementsByTagName('head')[0].appendChild(_readability_script); _readability_css=document.createElement('LINK'); _readability_css.rel='stylesheet'; _readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css'; _readability_css.type='text/css'; _readability_css.media='screen'; document.getElementsByTagName('head')[0].appendChild(_readability_css); _readability_print_css=document.createElement('LINK'); _readability_print_css.rel='stylesheet'; _readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css'; _readability_print_css.media='print'; _readability_print_css.type='text/css'; document.getElementsByTagName('head')[0].appendChild(_readability_print_css); }); define_key(content_buffer_normal_keymap, "z", "readability_arc90"); // Remember the last save directory for downloads { let _save_path = get_home_directory(); function update_save_path(info) { _save_path = info.target_file.parent.path; } add_hook("download_added_hook", update_save_path); suggest_save_path_from_file_name = function (filename, buffer) { let file = make_file(_save_path); file.append(filename); return file.path; } } // Default Zoom Level function my_zoom_set (buffer) { browser_zoom_set(buffer, false, 100); } add_hook('create_buffer_hook', my_zoom_set); // Url Remoting Multiple Targets /* For url_remoting_fn; load in a new buffer. If +u is given on the * command line, do so in the background. */ function load_url_in_new_buffer_perhaps_bg(url, ctx) { create_buffer_in_current_window( buffer_creator(content_buffer, $opener = ctx, $load = url), ctx.prefix_argument ? OPEN_NEW_BUFFER_BACKGROUND : OPEN_NEW_BUFFER, !ctx.prefix_argument); } // Create a TinyURL for the Current Buffer's URL // last updated February 5, 2009 define_browser_object_class( "tinyurl", "TinyURL", "Get a tinyurl for the current page", function (I, prompt) { check_buffer(I.buffer, content_buffer); let createurl = 'http://tinyurl.com/api-create.php?url=' + encodeURIComponent( load_spec_uri_string( load_spec(I.buffer.top_frame))); try { var content = yield send_http_request( load_spec({uri: createurl})); yield co_return(content.responseText); } catch (e) { } }); define_key(content_buffer_normal_keymap, "* q", "browser-object-tinyurl"); url_remoting_fn = load_url_in_new_buffer_perhaps_bg; // Google Binds require("page-modes/google-search-results.js"); google_search_bind_number_shortcuts(); // override google-search-results mode keybindings for navigation var gs_maps = Array( "j" , "cmd_scrollLineDown", "k" , "cmd_scrollLineUp", "o" , "find-url", "/" , "isearch-forward" ); for (var i = 0; i < gs_maps.length; i += 1) define_key(google_search_results_keymap, gs_maps[i], gs_maps[i+1]); require('eye-guide.js'); require('wikipedia-didyoumean.js'); //Form field shit browser_prevent_automatic_form_focus_mode(true);