Created
April 16, 2011 01:47
-
-
Save oblique63/922765 to your computer and use it in GitHub Desktop.
Configuration file for the Conkeror web browser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load_paths.unshift("chrome://conkeror-contrib/content/"); | |
mode_line_mode(false); | |
// Disables security checking for FF extensions | |
session_pref("xpinstall.whitelist.required", false); | |
require("clicks-in-new-buffer.js"); | |
clicks_in_new_buffer_target = OPEN_NEW_BUFFER_BACKGROUND; | |
clicks_in_new_buffer_button = 1; | |
xkcd_add_title = true; | |
minibuffer_auto_complete_default = true; | |
url_completion_use_history = true; | |
url_completion_use_bookmarks = true; | |
//---{ Bookmarks }----------------------------------------- | |
define_webjump("extensions", "https://addons.mozilla.org/search/?q=%s", | |
$alternative = "https://addons.mozilla.org/"); | |
define_webjump("fb", "www.facebook.com"); | |
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search", | |
$alternative="http://www.youtube.com"); | |
define_webjump("youtube-favorites", "http://www.youtube.com/my_favorites"); | |
define_webjump("youtube-liked", "http://www.youtube.com/my_liked_videos"); | |
define_webjump("grooveshark","http://listen.grooveshark.com/#/search?q=%s", | |
$alternative = "http://listen.grooveshark.com/#/"); | |
define_webjump("hulu", "http://www.hulu.com/search?query=%s", | |
$alternative = "http://www.hulu.com/"); | |
define_webjump("hn", "http://www.google.com/search?q=site:news.ycombinator.com+%s", | |
$alternative = "http://news.ycombinator.com/"); | |
define_webjump("github", "https://github.com/search?q=%s", | |
$alternative = "https://github.com/"); | |
define_webjump("so", "http://stackoverflow.com/search?q=%s", | |
$alternative = "http://stackoverflow.com"); | |
define_webjump("amazon", "http://www.amazon.com/exec/obidos/external-search/?field-keywords=%s&mode=blended", | |
$alternative = "http://www.amazon.com"); | |
define_webjump("reddit", "http://www.reddit.com"); | |
define_webjump("wp", "http://www.wordpress.com"); | |
//---{ Search }---------------------------------------------- | |
define_webjump("urban", "http://www.urbandictionary.com/define.php?term=%s"); | |
define_webjump("imdb", "http://imdb.com/find?q=%s"); | |
define_webjump("imagesgoogle", "http://www.google.com/images?q=%s", | |
$alternative = "http://www.google.com/imghp"); | |
define_webjump("mdc", "https://developer.mozilla.org/Special:Search?search=%s&type=fulltext&go=Search"); | |
define_webjump("codesearch", "http://www.google.com/codesearch?q=%s"); | |
define_webjump("netflix", "http://www.netflix.com/Search?v1=%s"); | |
require("page-modes/wikipedia.js"); | |
wikipedia_webjumps_format = "wp-%s"; // controls the names of the webjumps. default is "wikipedia-%s". | |
define_wikipedia_webjumps("en"); | |
define_webjump("commandlinefu", function(term) { | |
return 'http://www.commandlinefu.com/commands/matching/' + | |
term.replace(/[^a-zA-Z0-9_\-]/g, '') | |
.replace(/[\s\-]+/g, '-') + | |
'/' + btoa(term); | |
}, | |
$argument = 'optional', | |
$alternative = "http://www.commandlinefu.com/" | |
); | |
//----{ Tools }--------------------------------------------------- | |
// is site down? | |
define_webjump("down?", function (url) { | |
if (url) { | |
return "http://downforeveryoneorjustme.com/" + url; | |
} else { | |
return "javascript:window.location.href='http://downforeveryoneorjustme.com/'+window.location.href;"; | |
} | |
}, $argument = "optional"); | |
// GMAIL | |
define_webjump("gmail", function(view) { | |
var base_url = "https://mail.google.com/mail/?shva=1#"; | |
var views = ["starred","sent","drafts","mbox","inbox","spam"]; | |
var options = ["in","to","from","subject","cc","bcc","label"]; | |
view = view.toLowerCase(); | |
var terms = []; | |
if (view.split(" ").length > 1) { | |
terms = view.split(" ").slice(1); | |
view = view.split(" ")[0]; | |
} | |
if (terms.length == 0) { | |
if (views.indexOf(view) > -1) | |
return base_url+view; | |
else if (view == "priority") | |
return base_url+"mbox"; | |
else | |
return base_url+"search/"+view; | |
} | |
// Go to Label | |
if (view == "label" && terms.length == 1) { | |
return base_url+"label/"+terms[1]; | |
} | |
// Search with options | |
else { | |
var url = base_url+"search/"; | |
// Specified a view to search in | |
if (views.indexOf(view) > -1) { | |
var i; | |
for (i=0; options.indexOf(terms[i]) == -1 && i < terms.length; i++) | |
url += terms[i]+"+"; | |
url += "in%3A"+view; | |
// has further options to go through | |
if (options.indexOf(terms[i]) > -1) | |
url += "+"; | |
else | |
return url; | |
terms = terms.slice(i); | |
} | |
// first argument is a search term | |
else if (options.indexOf(view) == -1) { | |
url += view+"+"; | |
} | |
// the first argument is an option | |
else { | |
url += view+"%3A"+terms[0]; | |
terms = terms.slice(1); | |
// check if there are still more options/terms to parse | |
if (terms.length > 0) | |
url += "+"; | |
else | |
return url; | |
} | |
for (var i=0; i < terms.length; i++) { | |
// if a valid option is found... | |
if (options.indexOf(terms[0]) > -1 && terms.length > 1) { | |
url += terms[i]+"%3A"+terms[i+1]; | |
i++; | |
} | |
else if (typeof terms[i] != "undefined") | |
url += terms[i]; | |
if (i != terms.length-1) | |
url += "+"; | |
} | |
return url; | |
} | |
}, | |
$argument = 'optional', | |
$alternative = "https://mail.google.com" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment