Hi,
I'm new with XPCOM technology and XPConnect.
I want to get some info from an XPCOM component. The code works well
when I load the file from my filesystem but not when I browse the file
from the website.
I've got an error : enablePrivilege not granted (when the file is
loaded from the locale filesystem a prompt appears to ask for
privileges and not when coming from the website).
The code is here :
<script language='javascript'>
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var gDirServiceProp =
Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties);
var gProfileDir =
gDirServiceProp.get("ProfD",Components.interfaces.nsIFile);
alert('Your dir is ' + gProfileDir.path);
}
catch (e)
{
alert ("error = " + e);
}
</script>
Thanks a lot by advance,
Rodrigue Butaye