Skip to content

fix: 修复firefox下载路径解析逻辑#1

Open
SurpassHR wants to merge 1 commit into
ybbapp:feature/firefoxfrom
SurpassHR:fix/firefox-send-file-name-to-ariang
Open

fix: 修复firefox下载路径解析逻辑#1
SurpassHR wants to merge 1 commit into
ybbapp:feature/firefoxfrom
SurpassHR:fix/firefox-send-file-name-to-ariang

Conversation

@SurpassHR
Copy link
Copy Markdown

当firefox捕获从文件选择框返回的文件路径时,直接把路径赋值给了文件名,导致下载时路径拼接为 默认下载路径+选择下载路径+文件名.后缀。
firefox原逻辑:
image
firefox现逻辑:
aria2-explorer-firefox-fix
chrome保持不变:
aria2-explorer-chrome

- 在 `download` 和 `send2Aria` 函数中,新增从 `downloadItem.filename` 中提取目录路径的逻辑
- 当 `filename` 包含路径分隔符(`\` 或 `/`)时,自动分离目录和文件名
- 优化路径赋值逻辑,仅在未设置 `dir` 时使用 `rpcItem.location` 作为默认目录
- 在 `BrowserCompat.hasAPI` 方法中,将 `typeof obj[part] !== 'undefined'` 检查改为更简洁的 `part in obj`
@SurpassHR SurpassHR force-pushed the fix/firefox-send-file-name-to-ariang branch from 4a07f4e to db8dd45 Compare March 6, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant