зеркало из https://github.com/mozilla/pjs.git
Bug 236627 getReferrer should create uris using the io service
r=neil sr=darin
This commit is contained in:
Родитель
d72de54a43
Коммит
efaa40fdef
|
@ -78,9 +78,7 @@ function getReferrer(doc)
|
||||||
var sourceURL = getContentFrameURI(focusedWindow);
|
var sourceURL = getContentFrameURI(focusedWindow);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
|
return makeURL(sourceURL);
|
||||||
uri.spec = sourceURL;
|
|
||||||
return uri;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -718,17 +716,6 @@ function makeFilePicker()
|
||||||
return Components.classes[fpContractID].createInstance(fpIID);
|
return Components.classes[fpContractID].createInstance(fpIID);
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeTempFile()
|
|
||||||
{
|
|
||||||
const mimeTypes = "TmpD";
|
|
||||||
const flContractID = "@mozilla.org/file/directory_service;1";
|
|
||||||
const flIID = Components.interfaces.nsIProperties;
|
|
||||||
var fileLocator = Components.classes[flContractID].getService(flIID);
|
|
||||||
var tempFile = fileLocator.get(mimeTypes, Components.interfaces.nsIFile);
|
|
||||||
tempFile.append("~sav" + Math.floor(Math.random() * 1000) + ".tmp");
|
|
||||||
return tempFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMIMEService()
|
function getMIMEService()
|
||||||
{
|
{
|
||||||
const mimeSvcContractID = "@mozilla.org/mime;1";
|
const mimeSvcContractID = "@mozilla.org/mime;1";
|
||||||
|
|
Загрузка…
Ссылка в новой задаче