Skip to content

Commit 4d89c22

Browse files
committed
feat: Fix for our Salesforce integration
This ensures the iFrame is created when the markup is rendered.
1 parent 65fb03b commit 4d89c22

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎src/embedded.js‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,25 @@ class HelloSign extends Emitter {
460460
`;
461461
}
462462

463+
// This is a fix for our Salesforce integration. As of
464+
// Q2 2021, it appears that Salesforce no longer allows
465+
// iFrames to be injected inside of other elements via
466+
// `innerHTML`.
467+
//
468+
// We check if the iFrame was created above, and if not
469+
// we build one.
470+
if (!elem.innerHTML.includes('<iframe')) {
471+
const baseModal = elem.firstChild;
472+
const modalContent = baseModal.lastChild;
473+
const iframe = document.createElement('iframe');
474+
475+
iframe.setAttribute('src', this._iFrameURL.href);
476+
iframe.setAttribute('name', settings.iframe.NAME);
477+
iframe.setAttribute('class', settings.classNames.IFRAME);
478+
479+
modalContent.appendChild(iframe);
480+
}
481+
463482
return elem.firstChild;
464483
}
465484

0 commit comments

Comments
 (0)