Steps to reproduce:
Actual result:
Brave tries to download “DropboxInstaller.exe” file
Extra QA steps:
Screenshot if needed:

Any related issues:
The function responsible for downloading the file is the registerForDownloadListener (app/filtering.js), which registers a listener for the will-download event using the Electron session. The callback for the will-download listener receives 3 parameters: event, item and webContent. The item parameter is an object with the getURL method, and it is returning the following link:
When it should be returning:
https://dl-web.dropbox.com/installer?build_no=32.4.23&plat=mac&tag=eJyrVipOLS7OzM-Lz0xRslIwNDU3NzSxMDA3NzGwsDQ3tjCwNLUwMrC0NDGyNDM3MjMFipib1AIAnh0Npg~~%40META&tag_token=AHoYZbCl9XgViodp5JrYy4LQZYJryEdOEY7qHiYj4LihIg
perhaps this issue should be moved to the muon repository @luixxiul.
I hope I have helped :).
@celicoo do you know how to fix that? If so it would be appreciated if you could create a PR on https://github.com/brave/muon, our folk of the original electron. thanks!
@luixxiul Sure :blush:
@celicoo nice find! Please ping @bridiver, @darkdh, @bbondy, or myself if you need help with creating a patch 😄
@bsclifton I was able to track the will-download event until here, but now i'm not finding how to recompile only muon, if possible.
@celicoo when building (fresh and after making changes), I'll use the browser-laptop-bootstrap project and build using the following:
npm run build -- --debug_build=true --official_build=false
As long as your changes are isolated to Muon (ex: the under src/electron), it likely won't cause a full recompile. In the area you linked, you can easily add some debug statements like so:
LOG(ERROR) << "message goes here";
(of course, you'd have to find how to get the DownloadItem into a string or otherwise printable object if you wanted to print the values it has)
you can use
LOG(EROR) << item->GetTargetFilePath().value();
for some reason we're sending an empty user-agent when the link is clicked, but when you type https://www.dropbox.com/download?os=mac manually it works correctly. The resourceType is listed as other which also seems odd, but might be correct. I've never looked closely at the resource type for a download link. I see the same thing with shields up and down
This issue was also reported by a user on Twitter.
The problem is caused by the [download] attribute. When it is present, an EXE is presented. When the attribute is not present, a DMG is presented:
<a href="/download?os=mac" download>Restart the Download</a>
The server responds with a location header resembling the following:
The browser then makes a request for that resource, which results in another response from the server having a content-disposition value of _attachment; filename=DropboxInstaller.exe_.
@bridiver, might be a thread to pull.
Testing with 0.25.0, this issue appears to be fixed. @bsclifton , can you close the issue?
Most helpful comment
@luixxiul Sure :blush: