mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 503222, check file types on drop last so that urls take priority,r=mano
This commit is contained in:
parent
158fe71341
commit
759610dfca
@ -2646,16 +2646,22 @@ var browserDragAndDrop = {
|
||||
case "text/x-moz-url":
|
||||
var split = dt.getData(type).split("\n");
|
||||
return [split[0], split[1]];
|
||||
case "application/x-moz-file":
|
||||
var file = dt.mozGetDataAt(type, 0);
|
||||
var name = file instanceof Components.interfaces.nsIFile ? file.leafName : "";
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var fileHandler = ioService.getProtocolHandler("file")
|
||||
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
|
||||
return [fileHandler.getURLSpecFromFile(file), name];
|
||||
}
|
||||
}
|
||||
|
||||
// For shortcuts, we want to check for the file type last, so that the
|
||||
// url pointed to in one of the url types is found first before the file
|
||||
// type, which points to the actual file.
|
||||
var file = dt.mozGetDataAt("application/x-moz-file", 0);
|
||||
if (file) {
|
||||
var name = file instanceof Ci.nsIFile ? file.leafName : "";
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var fileHandler = ioService.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
return [fileHandler.getURLSpecFromFile(file), name];
|
||||
}
|
||||
|
||||
return [ , ];
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user