diff --git a/src/index.js b/src/index.js index 0428f20..0b8da58 100644 --- a/src/index.js +++ b/src/index.js @@ -43,8 +43,8 @@ browser.contextMenus.onClicked.addListener((info) => { if (matchSave && matchSave.length === 2) { const path = matchSave[1]; - const url = MEDIA_TYPES.includes('info.mediaType') ? info.srcUrl : info.linkUrl; - const filename = url.substring(url.lastIndexOf('/') + 1); + const url = MEDIA_TYPES.includes(info.mediaType) ? info.srcUrl : info.linkUrl; + const filename = url.substring(url.lastIndexOf('/') + 1).replace(/[|&;$%@"<>()+,]/g, ''); browser.downloads.download({ url,