The code below works fine.

However, observer is called not only for global history elements,
displayed in Ctrl+H, but for some other elements.

So the problem is to determine that element belongs to
"NC:HistoryRoot" data store.

QUESTION: How to do this?


var histListener = {
 onAssert: function (dataSource, source, property, target) {
           //
           // HERE WE WILL GET NEW ELEMENTS FOR GLOBAL HISTORY
           //
 },
 QueryInterface: function (aIID) {
   if (!aIID.equals (Components.interfaces.nsISupports) && !aIID.equals 
(Components.interfaces.nsIRDFObserver))
      throw Components.result.NS_ERROR_NO_INTERFACE; 
   return this;
 }
};

function ListenHistory() {
   // dsHistory is "rdf:history".
   dsHistory.AddObserver (histListener);
}

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to