test
const iFrameID = 'TestFrame';
const srcDomain = 'e.coram.eu';
const errorPage = 'https://coram.eu/not-found';
const mainUrl = window.location;
const queryString = mainUrl.search;
const urlParams = new URLSearchParams(queryString);
if (urlParams.has("form")) {
const formUrl = urlParams.get('form')
if (formUrl.includes(srcDomain)) {
top.document.getElementById(iFrameID).setAttribute("src", formUrl);
}
else {
// error in iframe
// top.document.getElementById(iFrameID).setAttribute("src", errorPage);
// redirect to error
window.location.replace(errorPage);
}
}