MCPcopy Create free account
hub / github.com/anilkumarum/mark-clipper / createNoteCxtMenu

Function createNoteCxtMenu

background/attachment.js:88–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected