Skip to content

Commit

Permalink
Merge pull request #49 from Mozilla-Ocho/unsupported-characters-html
Browse files Browse the repository at this point in the history
Adding support for the colon character
  • Loading branch information
katetaylormoz authored Feb 28, 2024
2 parents 6026de3 + 7e83207 commit 7abd147
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extension/popup/memory_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ async function generateFileName(ext) {
return subfileName;
}
})
.then ((fileName)=> {
return fileName.replaceAll(":","");
})
.catch((error) => {
reject(`Error querying tabs: ${error}`);
});
Expand Down Expand Up @@ -52,6 +55,7 @@ async function saveHtml() {
const text = await send({ action: "getPageText" });
let fileName = await generateFileName("html");
fileName = `${DOWNLOAD_SUBDIRECTORY}/PAGE-${fileName}`;
console.log(fileName);
const file = new File([text], fileName, { type: "text/plain" });
const url = URL.createObjectURL(file);
browser.downloads.download({ url, filename: fileName, saveAs: false });
Expand Down

0 comments on commit 7abd147

Please sign in to comment.