Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • WindowPostMessageProxy

Index

Constructors

constructor

  • Parameters

    • Default value options: IWindowPostMessageProxyOptions = {processTrackingProperties: {addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties},isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,receiveWindow: window,name: WindowPostMessageProxy.createRandomString()}

    Returns WindowPostMessageProxy

Properties

Private addTrackingProperties

addTrackingProperties: IAddTrackingProperties

Private eventSourceOverrideWindow

eventSourceOverrideWindow: Window

Private getTrackingProperties

getTrackingProperties: IGetTrackingProperties

Private handlers

handlers: IMessageHandler[]

Private isErrorMessage

isErrorMessage: IIsErrorMessage

Private logMessages

logMessages: boolean

Private name

name: string

Private pendingRequestPromises

pendingRequestPromises: IDeferredCache

Private receiveWindow

receiveWindow: Window

Private suppressWarnings

suppressWarnings: boolean

Private windowMessageHandler

windowMessageHandler: function

Type declaration

    • (e: MessageEvent): any
    • Parameters

      • e: MessageEvent

      Returns any

Static Private messagePropertyName

messagePropertyName: string = "windowPostMessageProxy"

Methods

addHandler

Private onMessageReceived

  • onMessageReceived(event: MessageEvent): void

postMessage

  • postMessage<T>(targetWindow: Window, message: any): Promise
  • Post message to target window with tracking properties added and save deferred object referenced by tracking id.

    Type parameters

    • T

    Parameters

    • targetWindow: Window
    • message: any

    Returns Promise

removeHandler

Private sendResponse

  • sendResponse(targetWindow: Window, message: any, trackingProperties: ITrackingProperties): void
  • Send response message to target window. Response messages re-use tracking properties from a previous request message.

    Parameters

    Returns void

start

  • start(): void

stop

  • stop(): void

Static Private createDeferred

Static Private createRandomString

  • createRandomString(): string

Static defaultAddTrackingProperties

Static defaultGetTrackingProperties

Static defaultIsErrorMessage

  • defaultIsErrorMessage(message: any): boolean

Generated using TypeDoc