code: function attachBrowserEvents(self) {
    if (isChromeApp()) {
      chrome.storage.onChanged.addListener(function (e) {
        // make sure it's event addressed to us
        if (e.db_name != null) {
          //object only has oldValue, newValue members
          self.emit(e.dbName.newValue);
        }
      });
    } else if (hasLocalStorage()) {
      if (typeof addEventListener !== 'undefined') {
        addEventListener("storage", function (e) {
          self.emit(e.key);
        });
      } else { // old IE
        window.attachEvent("storage", function (e) {
          self.emit(e.key);
        });
      }
    }
  }
docs: /* istanbul ignore next