From d7cff56116f27b53a96504b68fdcf6f988c72133 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 24 Jan 2024 11:07:39 +0100 Subject: [PATCH] fixed: share target --- main.js | 7 +++---- manifest.json | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index d739bc2..fd9aeb8 100644 --- a/main.js +++ b/main.js @@ -1206,7 +1206,7 @@ function loadstorage() localdata = item ? JSON.parse(item) : []; var params = new URLSearchParams(window.location.search); - var title = params.get("n"); + var title = params.get("n") || params.get("name"); var line = params.get("l"); var tags = params.get("t"); var clip = params.get("c"); @@ -1220,8 +1220,7 @@ function loadstorage() msg.innerText = "Clipping..."; notepage.appendChild(msg); - inserttodo("@clip " + clip) - .then(window.close); + inserttodo("@clip " + clip).then(window.close); } if (currentnote) @@ -1233,7 +1232,7 @@ function loadstorage() currentnote = getnote(title); if (!currentnote) { - var newcontent = defaultheaders(tags); + var newcontent = params.get("description") || defaultheaders(tags); currentnote = {title: title, content: newcontent, pos: newcontent.length}; localdata.unshift(currentnote); } diff --git a/manifest.json b/manifest.json index a2789de..078091d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "share_target": { - "action": "/index.html", + "action": "/", "params": { "title": "name",