Class: Browser

Browser()

new Browser()

Used internally by Client to provide the low-level interaction with SE servers.
Properties:
Name Type Description
loggedIn boolean User logged in
chatFKey Promise.<string> The chat key for use with ws-auth, and other authy endpoints
userId Promise.<number> The user id of the logged in user
userName Promise.<string> The user name of the logged in user
Source:

Methods

(async) getProfile(userId) → {Promise.<Object>}

Fetches a users profile
Parameters:
Name Type Description
userId number The user to fetch
Source:
Returns:
The profile object
Type
Promise.<Object>

(async) joinRoom(id) → {Promise.<void>}

Joins a room with the provided ID
Parameters:
Name Type Description
id number The room ID to join
Source:
Returns:
A promise that resolves with the user has successfully joined the room
Type
Promise.<void>

(async) login(email, password) → {string}

Attempts to login to stack exchange, using the provided email and password. Returns a cookie jar string, which you can pass back in to loginCookieJar for use with further logins.
Parameters:
Name Type Description
email string Email
password string Password
Source:
Returns:
A cookie jar containing account pertitent details.
Type
string

(async) loginCookie(cookieJar) → {void}

Attempts to login to stack exchange, using the provided cookie jar string, which was retrieved from the Browser#login method.
Parameters:
Name Type Description
cookieJar string A cookie jar string
Source:
Returns:
Type
void

sendMessage(roomId, message) → {Promise.<void>}

Sends a message to a room
Parameters:
Name Type Description
roomId number The room ID to send to
message string The message to send
Source:
Returns:
A promise that resolves when the message has been sent
Type
Promise.<void>

(async) watchRoom(id) → {Promise.<WebSocket>}

Watch a room, and returns the websocket
Parameters:
Name Type Description
id number The room ID to join
Source:
Returns:
The websocket of this room
Type
Promise.<WebSocket>