Methods
-
<async> launchBrowser()
-
Description
Launches the puppeteer controlled browser using the remote-debugging-port given in Haxroomie classes constructor. It is only possible to launch one browser.
Details
-
<async> closeBrowser()
-
Description
Closes the puppeteer controlled browser.
Details
-
hasRoom( id ) → {boolean}
-
Description
Checks if there is a room running with the given id.
Parameters
Name Type Description id
string | number An id of the room.
Returns
Details
-
getRoom( id ) → {RoomController}
-
Description
Returns a RoomController with the given id.
Parameters
Name Type Description id
string | number An id of the room.
Returns
Details
-
getRooms() → {Array.<RoomController>}
-
Description
Returns an array of available RoomControllers.
Returns
Details
-
getFirstRoom() → {RoomController}
-
Description
Returns the RoomController that was first added.
Returns
Details
-
<async> removeRoom( id )
-
Description
Removes a RoomController with the given id.
Removing deletes the RoomController and closes the browser tab it is controlling.
Parameters
Name Type Description id
string | number Details
-
<async> addRoom( roomController [, roomControllerOptions ] ) → {RoomController}
-
Description
Adds a new RoomController.
If
roomController
is a string or number, then it will be used as an id for the new RoomController.Parameters
Name Type Attributes Description roomController
RoomController | string | number Instance of RoomController or id for the RoomController.
roomControllerOptions
object <optional> Additional options for the RoomController constructor if
roomController
is an id.Returns
Details
Events
-
room-added
-
Description
Emitted when new RoomController is added.
Parameters
Name Type Description room
RoomController The added RoomController.
Details
-
room-removed
-
Description
Emitted when RoomController is removed.
Parameters
Name Type Description room
RoomController The removed RoomController.
Details