I seem to be getting a firefox error when using this code from
javascript.
my javascript code:
var myObserver = { observe : function(subject, topic, data) {
if (topic ==
"DISPID_SECURE_KDXAPIEVENT_CUSTOMEVENT") {
//alert("DISPID_SECURE_KDXAPIEVENT_CUSTOMEVENT");
//var dataArray =
data.split("|");
//var newTopic =
dataArray[0];
//var newData =
dataArray[1];
//alert(newTopic);
//alert(newData);
//gInstance.OnCustomEvent(newTopic,
newData);
}
};
// register the observer
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var observerService =
Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.addObserver(myObserver,
"DISPID_SECURE_KDXAPIEVENT_CUSTOMEVENT", false);
That code runs without any errors. However, notice all the commands
that are commented out. If I try to insert any javascript at all in the
if statement, I get the following errors in Firefox:
Error: [Exception... "'Permission denied to get property
XULElement.accessKey' when calling method:
[nsIDOMXULLabelElement::accessKey]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::
file:///C:/cvs/ffhiqtest/kdx_wrapper.js :: anonymous :: line 1033"
data: no]
Source File: file:///C:/cvs/ffhiqtest/kdx_wrapper.js
Line: 1033
Error: [Exception... "'Permission denied to get property
XULElement.disabled' when calling method:
[nsIDOMXULControlElement::disabled]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::
file:///C:/cvs/ffhiqtest/kdx_wrapper.js :: anonymous :: line 1033"
data: no]
Source File: file:///C:/cvs/ffhiqtest/kdx_wrapper.js
Line: 1033
If I search the web on permission denied errors regarding XULElement,
they all point to adding some 'autocomplete=off' statment inside your
input statements. I dont have any input statements though! The entire
point of this venture is worthless if I can't put any logic into my
clalback function.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom