MacTan wrote:
> 
> Hi,
> 
>     I am using netscape 6.1 and have build the debug version of sample.dll
> using 0.9.2.1 source code.
> I have copied the sample.dll and the xpt files to the components dir. When I
> try to launch the xpconnect-sample.html, I encounter a js file error
> "uncaught exception, enable privilege not granted.
> 
> what is wrong?

Sounds like you are probably trying to run xpconnect-sample.html
from a server. The browser security system will not allow calls
to  netscape.security.PrivilegeManager.enablePrivilege to even
bother the user with a security dialog (much less actually
succeed) for non-local files unless the files are are signed.

You are going to need to look into script signing if you need to
do arbitrary xpcom calls from JavaScript.

If you are working on a plugin then you'll want to know that
calls from JavaScript to methods on native objects that implement
the nsIPluginInstance interface are allowed without the need for
a successful call to
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect").
This was done to support legacy plugin scripting JS code.

For security questions you should post in:
news://news.mozilla.org/netscape.public.mozilla.security

For plugin questions you should post in:
news://news.mozilla.org/netscape.public.mozilla.plugins

John.

> 
> thanks

Reply via email to