Embed/embedding a Hireflix interview in Wix (similar on any other platform Webflow etc...)?

Updated by Antonio

How to embed/embedding a Hireflix interview in Wix.

To embed a Hireflix interview in a Wix website is super easy. Keep in mind that for it to work properly you need a Wix paid plan and a site with its own domain. To learn how to embed Hireflix in Wix, check the video below:

Careful if you use custom domains you may encounter a 404 error if things are not configured properly. Check the end of this article for more info.
<iframe src="YOUR LINK HERE"
allow="camera *; microphone *; autoplay *; encrypted-media *; fullscreen *; display-capture *;"
width="100%"
height="100%"
style="border: none; border-radius: 20px"
>
</iframe>

IMPORTANT: This is the code I mention on the video. Just copy it and paste it where I mention on the video above 😊🙏:

<script>
function addPermissions (iframe) {
const ALLOW_PERMISSIONS = 'camera *; microphone *; autoplay *; encrypted-media *; fullscreen *; display-capture *;'
if (iframe.allow === ALLOW_PERMISSIONS) {
return
}
iframe.setAttribute('allow', ALLOW_PERMISSIONS)
iframe.allow = ALLOW_PERMISSIONS
iframe.src = iframe.src
}
document.querySelectorAll('iframe').forEach(addPermissions)
const observer = new MutationObserver(function (mutationsList, observer) {
for(let mutation of mutationsList) {
if (mutation.addedNodes && mutation.addedNodes.length) {
for (let node of mutation.addedNodes) {
if (node.querySelectorAll) {
node.querySelectorAll('iframe').forEach(addPermissions)
}
}
}
}
})
observer.observe(document.body, { attributes: false, childList: true, subtree: true })
</script>

How to avoid a 404 error when using custom domains.

If you are trying to implement embedding, and you are using custom domains, and you are getting a 404 error, the reson is the below.

For security reasons, when an interview uses a custom domain like interview.yourdomain.com it can only be loaded inside an iframe from:

  1. Subdomains of yourdomain.com (e.g., something.yourdomain.com)
  2. app.hireflix.com

You are probably getting the error because you are trying to load it for example from a webflow link, but since the main domain webflow.com doesn’t match yourdomain.com, it’s being blocked.

This security measure is in place to prevent malicious sites from embedding the interview without permission and potentially tracking clicks or keystrokes. For example, without this restriction, a site like evil{.}com could embed the interview page and carry out these kinds of attacks. The solution, if the issue is on webflow, would be to use a custom domain something.yourdomain.com on webflow: https://help.webflow.com/hc/en-us/articles/33961334343827-Connect-a-custom-domain-overview


How did we do?


Powered by HelpDocs (opens in a new tab)