commit 760adf4d85e9fae5c42956a68dd9e98b086c3ed7 Author: Jeena Date: Mon Jan 29 19:03:39 2018 +0100 Initial commit The first version of the plugin with a hard coded url to my website. diff --git a/README.md b/README.md new file mode 100644 index 0000000..64a4ef5 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +Indie Reply Button +================== + +This is a WebExtension which I use to replace my bookmarklet which redirected +my browser to a form on my website with the current URL as a parameter. Sadly +because of the Content Security Policy it stopped working. The functionality +of that bookmarklet is now in this WebExtension. + +To load it check it out somewhere and then open: + +[about:debugging](about:debugging) + +On this page you can load the plugin temporarily to test it. diff --git a/background.js b/background.js new file mode 100644 index 0000000..131cc42 --- /dev/null +++ b/background.js @@ -0,0 +1,13 @@ +function openPage(url) { + browser.tabs.create({ + url: "https://jeena.net/notes/new?in_reply_to=" + url + }); +} + +async function buttonClicked() { + const [tab] = await browser.tabs.query({currentWindow: true, active:true}); + console.log(tab) + openPage(tab.url); +} + +browser.browserAction.onClicked.addListener(buttonClicked); diff --git a/icons/icon-16.png b/icons/icon-16.png new file mode 100644 index 0000000..c8d71de Binary files /dev/null and b/icons/icon-16.png differ diff --git a/icons/icon-32.png b/icons/icon-32.png new file mode 100644 index 0000000..f72c18e Binary files /dev/null and b/icons/icon-32.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..6d089c7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,22 @@ +{ + + "description": "Indie Reply Button", + "manifest_version": 2, + "name": "indie-reply-button", + "version": "1.0", + + "background": { + "scripts": ["background.js"] + }, + + "browser_action": { + "default_icon": { + "16": "icons/icon-16.png", + "32": "icons/icon-32.png" + } + }, + + "permissions": [ + "tabs" + ] +}