Class: WindowProxy

WindowProxy

Proxy window object to post message to target window

new WindowProxy

Parameters:
Name Type Description
proxyIFrameUrl string Fully qualified url to proxy iframe
targetWindowName string Name of the proxy iframe window
Source:
  • porthole.js, line 144

Methods

addEventListener

Add an event listener to receive messages.

Parameters:
Name Type Description
eventListenerCallback Function
Source:
  • porthole.js, line 161
Returns:
eventListenerCallback
Type
Function

post

Post a message to the target window only if the content comes from the target origin. targetOrigin can be a url or *

Parameters:
Name Type Description
data Object Payload
targetOrigin String
Source:
  • porthole.js, line 154

removeEventListener

Remove an event listener.

Parameters:
Name Type Description
eventListenerCallback Function
Source:
  • porthole.js, line 167

<static> serialize

Serialize an object using JSON.stringify

Parameters:
Name Type Description
obj Object The object to be serialized
Source:
  • porthole.js, line 362
Returns:
Type
String

<static> unserialize

Unserialize using JSON.parse

Parameters:
Name Type Description
text String Serialization
Source:
  • porthole.js, line 376
Returns:
Type
Object