зеркало из https://github.com/mozilla/pjs.git
Bug 464795 - Persist "save as" directory during private browsing, but restore previous value after (follow-up fix); r=gavin
This commit is contained in:
Родитель
bbcc716f14
Коммит
3b760a0c3b
|
@ -508,9 +508,11 @@ function getTargetFile(aFpP, /* optional */ aSkipPrompt)
|
|||
var dnldMgr = Components.classes["@mozilla.org/download-manager;1"]
|
||||
.getService(Components.interfaces.nsIDownloadManager);
|
||||
try {
|
||||
var lastDir = prefs.getComplexValue("lastDir", nsILocalFile);
|
||||
var lastDir;
|
||||
if (inPrivateBrowsing && gDownloadLastDir.path)
|
||||
lastDir = gDownloadLastDir.path;
|
||||
else
|
||||
lastDir = prefs.getComplexValue("lastDir", nsILocalFile);
|
||||
if ((!aSkipPrompt || !useDownloadDir) && lastDir.exists())
|
||||
dir = lastDir;
|
||||
else
|
||||
|
|
|
@ -257,10 +257,12 @@ nsUnknownContentTypeDialog.prototype = {
|
|||
|
||||
// The last directory preference may not exist, which will throw.
|
||||
try {
|
||||
var lastDir = prefs.getComplexValue("browser.download.lastDir",
|
||||
Components.interfaces.nsILocalFile);
|
||||
var lastDir;
|
||||
if (inPrivateBrowsing && gDownloadLastDir.path)
|
||||
lastDir = gDownloadLastDir.path;
|
||||
else
|
||||
lastDir = prefs.getComplexValue("browser.download.lastDir",
|
||||
Components.interfaces.nsILocalFile);
|
||||
if (isUsableDirectory(lastDir))
|
||||
picker.displayDirectory = lastDir;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче