mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
241865 - drag and drop link to download manager doesn't work, patch by pike <pike@pikey.me.uk> r=ben@mozilla.org
This commit is contained in:
parent
1a7cfd53f4
commit
a25f95dce5
@ -112,7 +112,10 @@ function isContentFrame(aFocusedWindow)
|
||||
function getContentFrameURI(aFocusedWindow)
|
||||
{
|
||||
var contentFrame = isContentFrame(aFocusedWindow) ? aFocusedWindow : window.content;
|
||||
return Components.lookupMethod(contentFrame, 'location').call(contentFrame).href;
|
||||
if (contentFrame)
|
||||
return Components.lookupMethod(contentFrame, 'location').call(contentFrame).href;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
function getReferrer(doc)
|
||||
@ -120,13 +123,13 @@ function getReferrer(doc)
|
||||
var focusedWindow = doc.commandDispatcher.focusedWindow;
|
||||
var sourceURL = getContentFrameURI(focusedWindow);
|
||||
|
||||
try {
|
||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
|
||||
uri.spec = sourceURL;
|
||||
return uri;
|
||||
} catch (e) {
|
||||
return null;
|
||||
if (sourceURL) {
|
||||
try {
|
||||
return makeURL(sourceURL);
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
const kSaveAsType_Complete = 0; // Save document with attached objects
|
||||
|
Loading…
Reference in New Issue
Block a user