A package wrapping the postMessage function with helper functions and security checks.
const unsubscribe = avMessage.subscribe(event, fn) when a message event is received and verified, fn will be called with the event data.
it returns a function that can be used to unsubscribe from that event
avMessage.unsubscribe(eventName) will remove all listeners for this event.
avMessage.unsubscribeAll() will remove all listeners for all events.
if a value is passed in, sets messaging's enabled flag true/false based on value.
returns boolean enabled flag value.
returns a string of the windows current domain.
avMessage.send(payload, target) will send the payload to the target if AvMessage is enabled.
target defaults to the parent window. payload will be stringified if not a string.