mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +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;
|
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 basename = OS.Path.basename(target);
|
||||||
const ext = basename.match(/\.([^.]+)$/);
|
const ext = basename.match(/\.([^.]+)$/);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user