@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 709 B
JavaScript
import{warn as t}from"../../../utilities/logger.js";const e=(e,a,s)=>{const i=e.origin,o=a.indexOf("/checkoutshopper/");let n=o>-1?a.substring(0,o):a;const r=n.length-1;return"/"===n.charAt(r)&&(n=n.substring(0,r)),i===n||(s&&t("WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!\n Received message with origin:",i,"but the only allowed origin for messages to CSF is",n,"### event.data=",e.data),!1)},a=t=>t.data&&t.data.type&&"string"==typeof t.data.type&&t.data.type.includes("webpack"),s=t=>t.data&&"string"==typeof t.data&&t.data.includes("cvox");export{s as isChromeVoxPostMsg,a as isWebpackPostMsg,e as originCheckPassed};
//# sourceMappingURL=postMessageValidation.js.map