Kate X wrote:
After a couple of days of debugging , I am able to start the update service
when application startup, but during the checkForUpdates, when trying to
open xmlhttprequest for update.xml, I got this error:

JavaScript Error: "[Exception... "Cannot modify properties of a
WrappedNative"  nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)"
location: "JS frame ::
file:///c:/Development/Client/Bin/Debug/components/nsUpdateService.js ::
anonymous :: line 1745"  data: no]"
in lines :
    this._request.onerror     = function(event) { self.onError(event);    };
    this._request.onload      = function(event) { self.onLoad(event);     };
    this._request.onprogress  = function(event) { self.onProgress(event); };

And I checked the doc of nsIXMLHttpRequest.idl, it says these are meant to
be script-only mechanism, and should not be used from native code. But this
error seems tell that I tried to use it from native code, I don't know
what's wrong.

Could anyone help me out with this?

The error suggests that XPConnect is not aware that the underlying object also implements nsIJSXMLHttpRequest. So, it looks like XPConnect thinks you are trying to add arbitrary properties rather than accessing the declared attributes. Doing an explicit QueryInterface call before trying to access these attributes would probably remedy this. See other code that does exactly that:

http://lxr.mozilla.org/seamonkey/search?string=nsIJSXMLHttpRequest

Although, it looks like the DOM implementation of the class is setting up classinfo stuff. So, I'm not really sure from a very quick look why this is not happening automatically. Neverthless, the lxr link above shows instances where others are doing explicit QueryInterface calls to do what you are trying to do.

John.

Thanks,

Kate.
"Kate X" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi there,

Here we have developed our own plugins, I want to use the updateservice to
check the updates of our plugin,  how should I do? The implementation is
in
javascript nsUpdateService.js, but when I try to get it I got missing
xulruntime error.
Anyone could give me a lead on this?
Thx,

Kate




_______________________________________________
dev-tech-xpcom mailing list
dev-tech-xpcom@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to