Yes, UniversalXPConnect should allow this. One thing to keep in mind is
scope - enabled privileges remain in effect until the function that
called enablePrivilege goes out of scope. This means that privileges
enabled in a top-level script will not apply to event handlers. If that
doesn't clear up the problem, can you send me a testcase? Make your
testcase as little code as possible to demonstrate the problem, and I'll
try to diagnose it - it may be a bug in the browser.
Regards,
-Mitch
MK wrote:
> I am trying to allow a remote XUL file premission to access
> nsIHTMLEditor. When i set
> netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
> I still cannot create a query interface to the HTML editor. I get
> presented with a security privilege dialog when I run the script and I
> grant the permission.
>
> Error: [Exception... "'Permission denied to create wrapper for object '
> when calling method: [nsIDocumentStateListener::NotifyDocumentCreated]"
> nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location:
> "<unknown>" data: no]
>
> The code looks like this
>
> var htmlEditor =
> editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
>
> Should UniversalXPConnect allow for this? My understanding is that it
> should. Also, I've tried enabling other privileges such as
> BrowserWrite, and BrowserAccess.
>