Observing changes to #bookmarks and tags
▻https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Bookmarks#Observing_changes_to_bookmarks_and_tags
Observing changes to bookmarks and tags
To set up an observer to listen for changes related to bookmarks, you will need to create an nsINavBookmarkObserver object and use the nsINavBookmarksService.addObserver() and nsINavBookmarksService.removeObserver() methods. Note that this example takes advantage of XPCOMUtils to generate the nsISupports.QueryInterface() method.