mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
Bug 128398 Referrer column is empty for the History
Relanding relevant parts of patch following aviary branch landing
This commit is contained in:
parent
cf6bcaf781
commit
67b8912860
@ -68,7 +68,7 @@ function markLinkVisited(href, linkNode)
|
||||
|
||||
var uri = makeURL(href);
|
||||
if (!globalHistory.isVisited(uri)) {
|
||||
globalHistory.addURI(uri, false, true);
|
||||
globalHistory.addURI(uri, false, true, null);
|
||||
var oldHref = linkNode.getAttribute("href");
|
||||
if (typeof oldHref == "string") {
|
||||
// Use setAttribute instead of direct assignment.
|
||||
@ -430,23 +430,14 @@ function getTargetFile(aData, aSniffer, aContentType, aIsDocument, aSkipPrompt,
|
||||
// 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.
|
||||
// Note - this code is identical to that in 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+)\.)|((\d+)$)/,
|
||||
function (str, dot, dotNum, noDot, noDotNum, pos, s) {
|
||||
return (parseInt(str) + 1) + (dot ? "." : "");
|
||||
});
|
||||
}
|
||||
else {
|
||||
file.leafName = file.leafName.replace(/\.|$/, "-1$&");
|
||||
}
|
||||
parts = /(-\d+)?(\.[^.]+)?$/.test(file.leafName);
|
||||
file.leafName = RegExp.leftContext + (RegExp.$1 - 1) + RegExp.$2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return file;
|
||||
|
Loading…
Reference in New Issue
Block a user