(shotBlob, noteName)
| 29 | |
| 30 | /**@param {Blob} shotBlob, @param {string} noteName*/ |
| 31 | export async function writeScreenshotFile(shotBlob, noteName) { |
| 32 | const vaultHandle = await getVaultHandle(); |
| 33 | if (!vaultHandle) return chrome.tabs.create({ url: permissionUrl }); |
| 34 | |
| 35 | const imgName = new Date().toISOString().replaceAll(":", "-") + ".png"; |
| 36 | writeFile(shotBlob, imgName, "screenshots") |
| 37 | .then(async () => { |
| 38 | const imgAlt = "image"; |
| 39 | const imgShotLink = `\n`; |
| 40 | await appendImgLink(noteName, imgShotLink); |
| 41 | }) |
| 42 | .catch((err) => console.error(err)); |
| 43 | } |
| 44 | |
| 45 | /**@param {string} srcUrl, @param {string} noteName*/ |
| 46 | export async function writeAttachmentFile(srcUrl, noteName, pageUrl) { |
no test coverage detected