Mozilla-Ocho / Memory-Cache

MemoryCache is an experimental development project to turn a local desktop environment into an on-device AI agent
https://memorycache.ai/
Mozilla Public License 2.0
536 stars 23 forks source link

Add preceding slash to subdirectory path #36

Closed misslivirose closed 7 months ago

misslivirose commented 7 months ago

Previously, the extension would create a DownloadsMemoryCache folder instead of Downloads/MemoryCache. This fixed it, but I'm not sure if there's a better way.

johnshaughnessy commented 7 months ago

Hmm, it seems that the three ways to save have different requirements:

So I recommend changing only the silent-mode saveAsPDF path (instead of DOWNLOAD_SUBDIRECTORY):

 async function savePDF() {
   try {
     await browser.tabs.saveAsPDF({
-      toFileName: `${DOWNLOAD_SUBDIRECTORY}/PAGE${generateFileName("pdf")}`,
+      toFileName: `/${DOWNLOAD_SUBDIRECTORY}/PAGE${generateFileName("pdf")}`,
       silentMode: true, // silentMode requires a custom build of Firefox
     });
   } catch (_e) {

Otherwise, the saveHtml path breaks:

image