So i've modified the code :

function myObserver()
{
        alert("0");
        var observerService
=Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
        alert("1");
        observerService.addObserver(observer,"domwindowopened",true);
        alert("2");
        observerService.notifyObservers(subject,"domwindowopened","add");
        alert("3");
}

when i call this function only the 2 alerts "0" et "1" are printed on
the screen. Moreover, if i go to the console i've this message :

Erreur : uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.addObserver]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame ::
chrome://ter/content/ter.js :: myObserver :: line 109"  data: no]

_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to