Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动捕获导致其他扩展下载时丢失文件名 Auto capture conflict with other extension that uses chrome.downloads.download (filename missing) #114

Open
fireattack opened this issue Jan 8, 2023 · 5 comments
Labels

Comments

@fireattack
Copy link

fireattack commented Jan 8, 2023

Describe the bug
When auto capture is enabled, Aria2 for Chrome causes other extensions that download file to lose their assigned filename. I experienced it in the extension rajiko, but there could be others.

To Reproduce
Steps to reproduce the behavior:

  1. Enable Enable auto capture when download file size .. option. Size limit does not matter.
  2. Install this extension: https://chrome.google.com/webstore/detail/rajiko/ejcfdikabeebbgbopoagpabbdokepnff
  3. Open this https://radiko.jp/#!/ts/QRR/20230101220000
  4. Click rajiko's icon, then click "Download Timeshift"

Expected behavior
The downloaded file should be named QRR_20230101233000_20230102000000.aac.

Observed behavior
But when auto capture is enabled, the filename becomes eddb6791-7878-434e-87cb-452fa933304f.aac or some other UUID-like random filename.

Desktop (please complete the following information):

  • OS: Win10
  • Browser: Chrome 108.0.5359.125

Additional context

rajiko uses chrome.downloads.download() to download the file, and it supplies a proper filename:

https://github.com/jackyzy823/rajiko/blob/e2600c3397c1e93c465b46666878d21554a5614a/background.js#L694-L696

However once auto capture is enabled in Aria2 for Chrome, even when the file isn't actually captured (blacklist, too small, etc.), the filename is not actually used in download for some reason.

@fireattack fireattack changed the title Auto capture conflict with other extensions that uses chrome.downloads.download (filename missing) 自动捕获导致其他扩展下载时丢失文件名 Auto capture conflict with other extensions that uses chrome.downloads.download (filename missing) Jan 8, 2023
@fireattack fireattack changed the title 自动捕获导致其他扩展下载时丢失文件名 Auto capture conflict with other extensions that uses chrome.downloads.download (filename missing) 自动捕获导致其他扩展下载时丢失文件名 Auto capture conflict with other extension that uses chrome.downloads.download (filename missing) Jan 8, 2023
@alexhua
Copy link
Owner

alexhua commented Jan 9, 2023

This a legacy bug from Chrome. Just wait for a workaround or Chrome bug fix, please.

@alexhua
Copy link
Owner

alexhua commented Jan 25, 2023

After a investigation, we found maybe there is no solution or workaround to deal with this conflict. The only method is turning off the auto-capture function at this situation which is caused by the defect of Chrome extension API.

@fireattack
Copy link
Author

Thanks for the investigation. Would you mind to elaborate the bug, so I can report it to Chrome team?

@alexhua
Copy link
Owner

alexhua commented Jan 25, 2023

Thanks for the investigation. Would you mind to elaborate the bug, so I can report it to Chrome team?

You can refer to this Zhihu article https://zhuanlan.zhihu.com/p/432549456, which summarized the whole detail.
And I also gave a comment below.

The key point is that when extension uses onDeterminingFilename API, Chrome pass in a original filename of DownloadItem object which is not the one set by download API from other extension.

@alexhua
Copy link
Owner

alexhua commented Jan 25, 2023

PS: We must use onDeterminingFilename API to capture the Chrome download task

alexhua added a commit that referenced this issue Jun 6, 2024
1. Remind if captured other extension's download #114
2. Refine the dark mode css of option page
3. Avoid AriaNG reloading after launch UI
4. Fix a bug in download function
5. Refine the exportAllLinks function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants