Fix Referer handling and improve media naming in downloads - #134
Merged
Conversation
…e page A CDN with hotlink protection refuses an object to a client that does not say which page linked it. The extension has always captured the referer and sent it over the extbus; the app logged it and dropped it, so every request went out without one and the download failed where the browser succeeded — reported against a 4K MP4 that plays fine in the tab. The referer now travels with the item, like `StreamInfo::referer` already does for a manifest's segments: `ExtDownload` -> `DownloadItem::referer` -> `StartSpec` -> `request_headers`, which the transfer and every probe share. `probe_link` takes those headers too, so the File Info dialog asks the same question the transfer will and reports a real size instead of `?`. Verified against the reporter's own signed URL: without the referer the probe gets nothing, with it 109566922 bytes. Naming: `download-stream` already titled a captured stream after the page, `download-url` sent no name at all, so a direct file landed under whatever the CDN stored it as — a uuid, renamed by hand afterwards. A sniffed media file whose basename is opaque now takes the page title, as IDM does; a file that names itself, and any link the sniffer never saw, keep their own name. Also surfaces the background-download switch in Options > Downloads. It was reachable only from inside the File Info dialog, which is why the same report asked for a confirm-before-downloading button that already existed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
==========================================
- Coverage 73.98% 73.97% -0.01%
==========================================
Files 69 69
Lines 29154 29154
==========================================
- Hits 21569 21567 -2
- Misses 7585 7587 +2 🚀 New features to boost your workflow:
|
…r tick non-english translated using AI llm
m4siha
approved these changes
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A CDN with hotlink protection refuses an object to a client that does not say which page linked it. The extension has always captured the referer and sent it over the extbus; the app logged it and dropped it, so every request went out without one and the download failed where the browser succeeded — reported against a 4K MP4 that plays fine in the tab.
The referer now travels with the item, like
StreamInfo::refereralreadydoes for a manifest's segments:
ExtDownload->DownloadItem::referer->StartSpec->request_headers, which the transfer and every probe share.probe_linktakes those headers too, so the File Info dialog asks the same question the transfer will and reports a real size instead of?.Verified against the reporter's own signed URL: without the referer the probe gets nothing, with it 109566922 bytes.
Naming:
download-streamalready titled a captured stream after the page,download-urlsent no name at all, so a direct file landed under whatever the CDN stored it as — a uuid, renamed by hand afterwards. A sniffed media file whose basename is opaque now takes the page title, as IDM does; a file that names itself, and any link the sniffer never saw, keep their own name.Also surfaces the background-download switch in Options > Downloads. It was reachable only from inside the File Info dialog, which is why the same report asked for a confirm-before-downloading button that already existed.
Fixes #133