mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 23:12:21 +00:00
Bug 1623704 - Fix saveAs option of browser.downloads.download on Thunderbird. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D70470 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2b97c80ec2
commit
c7a24ee34a
@ -741,7 +741,14 @@ this.downloads = class extends ExtensionAPI {
|
||||
return target;
|
||||
}
|
||||
|
||||
const window = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!("windowTracker" in global)) {
|
||||
return target;
|
||||
}
|
||||
|
||||
// Use windowTracker to find a window, rather than Services.wm,
|
||||
// so that this doesn't break where navigator:browser isn't the
|
||||
// main window (e.g. Thunderbird).
|
||||
const window = global.windowTracker.getTopWindow().window;
|
||||
const basename = OS.Path.basename(target);
|
||||
const ext = basename.match(/\.([^.]+)$/);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user