Add copy links to markdown

复制链接到 Markdown
This commit is contained in:
2024-09-05 02:19:59 +08:00
parent a95d919b0e
commit ef23dda691
4 changed files with 53 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
chrome.runtime.onMessage.addListener((req) => {
// 复制精简链接
if (req.type === "toolbox:copyLinkToMarkdown") {
const link = `${location.origin}${location.pathname}`;
navigator.clipboard.writeText(`[${document.title}](${link})`);
}
// 复制完整链接带参数
if (req.type === "toolbox:copyLinkToMarkdownFull") {
navigator.clipboard.writeText(`[${document.title}](${location.href})`);
}
});