Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const initializeIframeResize = function( iframe ) {
return new iframeResize(
{
log: false,
sizeWidth: true,
checkOrigin: [ window.location.origin ],
heightCalculationMethod: 'documentElementOffset',
widthCalculationMethod: 'documentElementOffset',
onMessage: function( messageData ) {
let parent = iframe.parentElement;
if ( iframe.parentElement.classList.contains( 'modal-content' ) ) {
parent = parent.parentElement.parentElement;
}
switch ( messageData.message.action ) {
case 'giveEmbedFormContentLoaded':
const timer = setTimeout( function() {