From Bright Pattern Documentation

Revision as of 20:10, 2 April 2026 by Laura.donovan (talk | contribs) (Updated via BpClonePage extension. Source page: draft:AgentDesktop-client-side-javascript-api-specification/activatePage)

< Previous | Next >
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

activatePage

Sets current Communicator Widget instance to active. Works when you have multiple opened instances (i.e. browser tabs) of Communicator Widget. Active Communicator Widget accepts several singleton events which do not come to inactive tabs. These events include ON_OPEN_RECORD, ON_SEARCH_RECORDS, ON_SHOW_SCREEN, ON_SAVE_ACTIVITY_RECORD, ON_REQUEST_TRANSFER_DATA, ON_GET_KNOWLEDGE_BASE_FOLDER, ON_SEARCH_KNOWLEDGE_BASE, ON_GET_KNOWLEDGE_BASE_ARTICLE, ON_WEB_SCREEN_POP_CUSTOM, ON_VALIDATE_ASSOCIATED_RECORDS.

Usually you don't need to use this method as Communicator Widget tracks page activation by itself when you interact with the Communicator Widget UI.

Request

Syntax

activatePage(): Promise<OperationResult<null>>

Parameters

None

Example Request

    window.top.addEventListener("visibilitychange", () => {

        if (window.top.document.visibilityState === 'visible') {

            adApi.activatePage()

        }

    })

    window.top.addEventListener("focus", () => {

        adApi.activatePage()

    })

Return Value

null

< Previous | Next >