Documentation
    Preparing search index...

    Function pushToWindow

    • Push an envelope to a window through a mock built by defineMockService. With a runtime attached, delivery goes through ServiceRuntimeContext.sendToEligibleNapplet, whose verdict is returned: false means the runtime refused the push (unknown window, domain not exposed, missing recipient capability, or an undeclared custom-domain type) and nothing was recorded in mock.sent. Without a runtime, the last send seen for that window is used, and false means no request has been seen.

      Parameters

      • service: MockService

        A mock from defineMockService.

      • windowId: string

        Recipient window.

      • message: NappletMessage

        Envelope to deliver.

      Returns boolean

      Whether the envelope was delivered.

      pushToWindow(gamepad, 'win-1', { type: 'gamepad.state', pads: [] } as NappletMessage);