()
| 86 | } |
| 87 | |
| 88 | export async function createNoteCxtMenu() { |
| 89 | chrome.contextMenus.removeAll(); |
| 90 | chrome.contextMenus.create({ |
| 91 | id: "vaultPermission", |
| 92 | title: "Vault Permission", |
| 93 | contexts: ["action"], |
| 94 | }); |
| 95 | |
| 96 | chrome.contextMenus.create({ |
| 97 | id: "clipContent.md", |
| 98 | title: "Clip to Obsidian", |
| 99 | contexts: ["image"], |
| 100 | }); |
| 101 | |
| 102 | if (!vaultHandle) return; |
| 103 | const crtVaultNotes = []; |
| 104 | for await (const fileName of vaultHandle.keys()) { |
| 105 | if (fileName.endsWith(".md")) { |
| 106 | chrome.contextMenus.create({ |
| 107 | id: fileName, |
| 108 | title: fileName.slice(0, -3), |
| 109 | parentId: "clipContent.md", |
| 110 | contexts: ["image"], |
| 111 | }); |
| 112 | crtVaultNotes.push(fileName); |
| 113 | } |
| 114 | } |
| 115 | chrome.storage.local.set({ crtVaultNotes }); |
| 116 | } |
nothing calls this directly
no outgoing calls
no test coverage detected