in short: is there a way to find the current path to the full xul application path?
long explanation:
I would like to open some html files in an xul browser application. The path to the html files must be installed programmatically from the xul application. The html files are outside my xul application, but at the same level. (users will check both folders from SVN, without installing the xul application)
It opened the files perfectly if I set the full path, for example, "file: /// c: \ temp \ processing-sample \ index.html"
what i want to do is open the file regarding my xul application.
I found that I can open the path to the user profile:
var DIR_SERVICE = new Components.Constructor("@mozilla.org/file/directory_service;1", "nsIProperties");
var path = (new DIR_SERVICE()).get("UChrm", Components.interfaces.nsIFile).path;
var appletPath;
if (path.search(/\\/) != -1)
{
appletPath = path + "\\myApp\\content\\applet.html"
}
else
{
appletPath = path + "/myApp/content/applet.html"
}
var appletFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
appletFile.initWithPath(appletPath);
var appletURL = Components.classes["@mozilla.org/network/protocol;1?name=file"].createInstance(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromFile(appletFile);
var appletFrame = document.getElementById("appletFrame");
appletFrame.setAttribute("src", appletURL);
is there any way to find the current path to the full xul application path?