From: Jacob Casper Date: Fri, 13 Mar 2020 23:44:04 +0000 (-0500) Subject: Initial commit X-Git-Tag: v0.2~1 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=b6df761b92a8e5630df6dee01eb3debafe867d59;p=cliktionary.git Initial commit --- b6df761b92a8e5630df6dee01eb3debafe867d59 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f7661f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Cliktionary + +A Firefox WebExtension that lets you search Wiktionary for any text you right click. diff --git a/background.js b/background.js new file mode 100644 index 0000000..3ed7694 --- /dev/null +++ b/background.js @@ -0,0 +1,13 @@ +browser.menus.create({ + id: "cliktionary", + title: "Cliktionary", + contexts: ["selection"] +}); + +browser.menus.onClicked.addListener((info, tab) => { + switch (info.menuItemId) { + case "cliktionary": + browser.tabs.create({url: `https://en.wiktionary.org/wiki/${info.selectionText}`}); + break; + } +}); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..3ecb8ab --- /dev/null +++ b/manifest.json @@ -0,0 +1,16 @@ +{ + "manifest_version": 2, + "name": "Cliktionary", + "version": "0.1", + + "description": "Search Wiktionary for any text you right click.", + + "permissions": [ + "menus", + "tabs" + ], + + "background": { + "scripts": ["background.js"] + } +}