Last active
February 9, 2016 10:20
-
-
Save jasonalderman/9118dd742b1209f2bbf1 to your computer and use it in GitHub Desktop.
Chrome extension to look up words on Wordnik.
This file contains 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
An extension for Google Chrome that lets you look up words on Wordnik. | |
It's outdated—the manifest version is 1 when it should be 2—but it may work for you if you | |
• download the files | |
• go to chrome://extensions | |
• check "Developer Mode" | |
• "Load unpacked extension..." | |
The .zip file contains the following files: | |
- manifest.json | |
- background.html | |
- wordniklookup.js | |
- wordnikfavicon.png | |
- wordnik48.png | |
This file contains 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
<script src="wordniklookup.js"></script> |
This file contains 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
{ | |
"name": "Define Selection on Wordnik", | |
"description": "Adds a context menu item to look up selected text on http://wordnik.com/.", | |
"version": "0.1", | |
"icons": { | |
"16": "wordnikfavicon.png", | |
"48": "wordnik48.png"}, | |
"permissions": ["contextMenus","tabs"], | |
"background_page": "background.html" | |
} |
This file contains 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
// Modified from the sample code that was... | |
// Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
// Callback for loading definition in new tab | |
function defineWord(info, tab) { | |
chrome.tabs.create({ | |
"url": "http://www.wordnik.com/words/"+info.selectionText | |
}); | |
} | |
// Create context menu item for selections. | |
var id = chrome.contextMenus.create({"title": "Find definition on Wordnik", "contexts":["selection"], | |
"onclick": defineWord}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment