Google Chrome Omnibox Search extension that enables you to search Omgili (omgili.com) from the Omnibox. To use, simply type ‘omg’, a space, and your search query into the Omnibox, then choose a time frame from the drop down, and it will open your search results up in a new tab. Omgili is a time sensitive international message board search engine (in case you didn’t know).
manifest.json
{
"name" : "Omgili Search",
"short_name": "omg Search",
"description" : "To use, type 'omg' & space, and a query term into the Omnibox. timothytocci.com",
"version" : "0.1",
"background" : {
"scripts" : ["background.js"]
},
"omnibox" : {
"keyword" : "omg"
},
"icons" : {
"16" : "omg_16.png",
"32" : "omg_32.png",
"48" : "omg_48.png",
"128" : "omg_128.png"
},
"manifest_version" : 2
}
background.js
chrome.omnibox.onInputChanged.addListener(function (text, suggest) {
suggest([{
content : encodeURIComponent(text) + "&tf=day",
description : "Search Omgili in the past day (default)"
}, {
content : encodeURIComponent(text) + "&tf=week",
description : "Search Omgili in the past week"
}, {
content : encodeURIComponent(text) + "&tf=month",
description : "Search Omgili in the past month"
}, {
content : encodeURIComponent(text) + "&tf=year",
description : "Search Omgili in the past year"
}, {
content : encodeURIComponent(text) + "&tf=any",
description : "Search Omgili with no time frame"
}
]);
});
chrome.omnibox.onInputEntered
.addListener(function (text) {
var createProperties = {
url : "http://omgili.com/search?q="
+ text
};
chrome.tabs.create(createProperties);
});
chrome.omnibox.onInputStarted
.addListener(function () {
var suggestion = {
description : "Omgili Message Board Search query: %s "
}
chrome.omnibox.setDefaultSuggestion(suggestion);
});
Leave a comment