public owns()

in src/XDM.ts [384:404]


    public owns(source: Window, origin: string, rpcMessage: IJsonRpcMessage): boolean {
        /// Determines whether the current message belongs to this channel or not
        if (this.postToWindow === source) {
            // For messages coming from sandboxed iframes the origin will be set to the string "null".  This is 
            // how onprem works.  If it is not a sandboxed iFrame we will get the origin as expected.
            if (this.targetOrigin) {
                if (origin) {
                    return origin.toLowerCase() === "null" || this.targetOrigin.toLowerCase().indexOf(origin.toLowerCase()) === 0;
                } else {
                    return false;
                }
            }
            else {
                if (rpcMessage.handshakeToken && rpcMessage.handshakeToken === this.handshakeToken) {
                    this.targetOrigin = origin;
                    return true;
                }
            }
        }
        return false;
    }