Add copy links to markdown
复制链接到 Markdown
This commit is contained in:
@@ -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})`);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user