   }
 
   @pref.observer.register()
+  @pref.ZoteroObserver.register()
+
 
   for own name, endpoint of @endpoints
     url = "/better-bibtex/#{name}"


  nids = []
  nids.push(Zotero.Notifier.registerObserver(@itemChanged, ['item']))
  nids.push(Zotero.Notifier.registerObserver(@itemAdded, ['collection-item']))
  window.addEventListener('unload', ((e) -> Zotero.Notifier.unregisterObserver(id) for id in nids), false)

  uninstaller = {
    onUninstalling: (addon, needsRestart) ->

        Zotero.BetterBibTeX.clearKey({itemID: id}, true)

      Zotero.BetterBibTeX.DB.query("delete from cache where itemid in (#{('' + id for id in extraData).join(',')})")
      collections = Zotero.Collections.getCollectionsContainingItems(extraData, true)

    when 'add', 'modify', 'trash'
      break if ids.length == 0

      collections = Zotero.Collections.getCollectionsContainingItems(ids, true)

      ids = '(' + ('' + id for id in ids).join(',') + ')'

