Browser Extension, Google Chrome, Javascript, Wikipedia-Search

Google Chrome Extension – Wikipedia Search, an Omnibox extension

Google Chrome Omnibox Search extension that enables you to search Wikipedia (wikipedia.com) from the Omnibox.  To use, simply type ‘wiki’, a space, and your search query into the Omnibox and it will open your search results up in a new tab.

manifest.json


{
	"name" : "Wikipedia Search",
	"short_name": "wiki Search",
	"description" : "To use, type 'wiki' & space, and a query term into the Omnibox. timothytocci.com",
	"version" : "0.1",
	"background" : {
		"scripts" : ["background.js"]
	},
	"omnibox" : {
		"keyword" : "wiki"
	},
	"icons" : {
		"16" : "wiki_16.png",
		"32" : "wiki_32.png",
		"48" : "wiki_48.png",
		"128" : "wiki_128.png"
	},
	"manifest_version" : 2
}

background.js


chrome.omnibox.onInputEntered.addListener(function (text) {
	var createProperties = {
		url : "http://en.wikipedia.org/w/index.php?search="
		 + encodeURIComponent(text)
	};
	chrome.tabs.create(createProperties);
});
chrome.omnibox.onInputStarted
.addListener(function () {
	var suggestion = {
		description : "Search Wikipedia for the query: %s "
	}
	chrome.omnibox.setDefaultSuggestion(suggestion);
});

Install Wikipedia Search Extension (chrome store)

Advertisement
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s