post_image - browser extension to share images quickly
git clone https://github.com/rj1/post_image
commit 9a4b5d48c86a0cf1bc8b45736526de23faaf2251 parent 1bfee640e06f408a3fd00c40c19be3a808677ccb author: rj1 <[email protected]> date: Sun, 21 May 2023 20:57:00 -0600 trim newline from url when placing it into clipboard Diffstat:
M | manifest.json | | | 2 | +- |
M | upload.js | | | 4 | ++++ |
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "POST Image", - "version": "0.7", + "version": "0.8", "icons": { "200": "icon.png" }, diff --git a/upload.js b/upload.js @@ -134,6 +134,10 @@ async function openNewTab(url) { } async function placeUrlInClipboard(url) { + + // trim newline from url + url = url.replace(/\n/g, ""); + // check if clipboardPlace is set to true const clipboardPlace = (await browser.storage.sync.get("clipboardPlace")) .clipboardPlace;