From 760adf4d85e9fae5c42956a68dd9e98b086c3ed7 Mon Sep 17 00:00:00 2001 From: Jeena Date: Mon, 29 Jan 2018 19:03:39 +0100 Subject: [PATCH] Initial commit The first version of the plugin with a hard coded url to my website. --- README.md | 13 +++++++++++++ background.js | 13 +++++++++++++ icons/icon-16.png | Bin 0 -> 257 bytes icons/icon-32.png | Bin 0 -> 434 bytes manifest.json | 22 ++++++++++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 README.md create mode 100644 background.js create mode 100644 icons/icon-16.png create mode 100644 icons/icon-32.png create mode 100644 manifest.json 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 0000000000000000000000000000000000000000..c8d71de0c4ad9a7a8f4349f7b5afecf4d97e0bb7 GIT binary patch literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY55O6*3aqU4E)2*A_r%sCn&Dx^)?Ph~mWJ}XY zrZ<;%OrBu7XQP2rM}k|9&Yrt9?;aW%FbSys6x+fwGkHS0-;^IU8mk^$yd&Ldx@!(RB9nu z>jwyeVzEE4Dk<^>l0s8PVk1_GwF*MMKoFD4N>V9^KcM&tDu|FY8sFGtl0d)|*~K7x ztL4tH_spBi!U_Z0-YqYwQpF@dnIS@%(N?vlnUtcF@Y zn*0g;`wk=k2|xnS12Cfv-9MO^lrNU&0Ss#m0jOFN0HL;3IGl?kyo0L&sM8zo_r8Q? zQbO5KBur(#!d&qnQh*Ksg2DTg*}nHv{^9ZA_HB7(y#cc5#1;g}L