Handles the active Deputy session.

A "Session" is a period wherein Deputy exercises a majority of its features, namely the use of inter-tab communication and database transactions for page and revision caching. Other tabs that load Deputy will recognize the started session and begin communicating with the root tab (the tab with the CCI page, and therefore the main Deputy session handler, open). The handler for root tab session activities is DeputyRootSession.

Constructors

Properties

DeputyPageSession: typeof DeputyPageSession = DeputyPageSession
DeputyRootSession: typeof DeputyRootSession = DeputyRootSession
pageSession: DeputyPageSession

The DeputyPageSession handles session functions for a page that is the subject of a Deputy session. This object handles things such as synchronicity between the root tab and the page toolbar, interface handling, etc.

rootSession: DeputyRootSession

The DeputyRootSession handles session functions for the root tab. The separation between DeputySession and DeputyRootSession is made to confine session-mutating functions within the root tab only.

Methods

  • Broadcasts a sessionRequest message to the Deputy communicator to find other tabs with open sessions. This prevents two tabs from opening the same session at the same time.

    Returns Promise<boolean>

  • Detects if a session is currently active, attempt to get page details, and start a page session if details have been found.

    Returns Promise<boolean>

    true if a session was started, false otherwise.