Here is code snippet:
Components.classes['@mozilla.org/safebrowsing/application;1']
.getService().wrappedJSObject.malwareWarden.listManager_
.safeLookup(test_url, function(tableName){
if (tableName == 'goog-phish-shavar' || tableNmae == 'goog-malware-shavar') {
alert('This is reported by Google! ');
};
});
It works fine, but I don’t think it is the ‘right’ way…
What if user change the DataProvider?
Accessing any methods or properties of an XPCOM object using wrappedJSObject is a problem waiting to happen. Anything accessed via wrappedJSObject is considered “private” data and methods – potentially breaking in future releases. Try to avoid it.
The good news is the the “listManager” is itself a global XPCOM service. Access it directly using:
As for changing the data provider, it will take a fair amount of code changes to Firefox before that can happen. If it does, we would hopefully add some management methods to XPCOM as well.