Skip to content

Commit

Permalink
fix: タイトルにスペースが入っていた場合にダウンロードができない場合があるのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
mnao305 committed Jul 7, 2024
1 parent 21675e6 commit 5fbda9f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ export const download = async (url: string, filename: string, filepath: string):

const options: Downloads.DownloadOptionsType = {
url,
filename: `fantia/${downloadFilename}`,
// スペースは削除
filename: `fantia/${downloadFilename}`.replaceAll(' ', '').replaceAll(' ', ''),
saveAs: false,
conflictAction: 'overwrite'
}

browser.downloads.download(options)
browser.downloads.download(options).catch((e) => {
console.error(e, options)
}
)
}

interface DownloadEventMsg {
Expand Down

0 comments on commit 5fbda9f

Please sign in to comment.