Here is the code from the Evernote Web Clipper Extension, file common.js:
reloadAccounts() {
let e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
return (
(this._selectedAccountId = null),
(this._selectedSubpart = null),
(this._isOnline = !0),
this.getUserSlots()
.then((e) => (0 === e.length && e.push(0), I.ZP.log("detected auth in slots", e), e))
.then((t) => this._createAndLoadAccountsForSlots(t, e))
.then((e) => {
this._accountList = e.filter((e) => !!e);
const t = this._accountList.find((e) => !!e.userId);
t ? this.select(t.userId) : this._selectAccount(this._accountList[0]);
})
.then(() => this._updateSyncEngines())
.catch((e) => {
if ((I.ZP.error("Error in recreateAccounts", e), "object" != typeof e)) throw e;
if (
(e.code === G.kq.COOKIES_DISALLOWED &&
(0, me.Z)(
(0, h.ZP)(
"Evernote Web Clipper uses cookies to identify your account. Check your browser settings to make sure third-party cookies are accepted from Evernote.",
"Error message that shows when browser cookie config preventing clipper from login"
)
),
e.code === G.kq.MAINTENANCE && (0, me.Z)((0, h.ZP)("Evernote servers are under maintenance, please try again later", "Maintenance message")),
("undefined" != typeof ProgressEvent && e instanceof ProgressEvent) || e.code === G.wC.OFFLINE || (e.cause && "NetworkException" === e.cause.name))
)
throw ((this._isOnline = !1), G.rk.fromAny(e));
throw e;
})
);
}