зеркало из https://github.com/mozilla/gecko-dev.git
b215290 - Alt+Click does not follow download folder preferences
- make the call to saveURL from the Alt+Click handling pass the 'skipPrompt' flag, and also make the code in contentAreaUtils.js not overwrite existing files similar to 215194.
This commit is contained in:
Родитель
c29ac630de
Коммит
d66f5e9ecc
|
@ -346,6 +346,27 @@ function foundHeaderInfo(aSniffer, aData, aSkipPrompt)
|
||||||
// bugs.
|
// bugs.
|
||||||
dir.append(defaultString);
|
dir.append(defaultString);
|
||||||
file = dir;
|
file = dir;
|
||||||
|
|
||||||
|
// Since we're automatically downloading, we don't get the file picker's
|
||||||
|
// logic to check for existing files, so we need to do that here.
|
||||||
|
//
|
||||||
|
// Note - this code is identical to that in
|
||||||
|
// browser/components/downloads/content/nsHelperAppDlg.js.
|
||||||
|
// If you are updating this code, update that code too! We can't share code
|
||||||
|
// here since that code is called in a js component.
|
||||||
|
while (file.exists()) {
|
||||||
|
var parts = /.+-(\d+)(\..*)?$/.exec(file.leafName);
|
||||||
|
if (parts) {
|
||||||
|
file.leafName = file.leafName.replace(/((\d+)\.)/,
|
||||||
|
function (str, p1, part, s) {
|
||||||
|
return (parseInt(part) + 1) + ".";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
file.leafName = file.leafName.replace(/\./, "-1$&");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDocument)
|
if (isDocument)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче