question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cross-origin issue while accessing to iframe content

See original GitHub issue

I want to access to contentWindow of the iframe but I can’t access to the iframe element because cross-origin restrictions.

// run after loading new Question
function changed() {
        console.log('New Question')
        var iframe = document.querySelector(".tf-v1-widget");
        console.log(iframe.getElementsByTagName("iframe")[0].contentWindow.document)
}

image

Is there any way via Typeform Dashboard to disable CORS-blocking restrictions for specific website or any other solution to solove this problem?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mathiocommented, Jan 11, 2022

@ninja-pinky I am afraid that this is not something we support right now. Maybe we could send the form height as payload to the OnQuestionChanged event? 🤔 Would that be helpful?

0reactions
mathiocommented, Feb 17, 2022

Now you can use onHeightChanged callback. If you want to resize widget embed you can use autoResize option.

This issue was resolved in #463

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solve the Cross-Origin Access error when working with iframes
This post will breifly explain the Cross-Origin access problem that is faced when accesing an iframe document and how you can setup your ......
Read more >
how to resolve iframe cross domain issue - Stack Overflow
If the domain has explicitly blocked Cross-Origin requests, there's nothing you can do about it.
Read more >
Cross-origin communication in between iframe and it's parent ...
Yes, it's not any hack or something, but with simple functions you can communicate in between iframe and it's parent website.
Read more >
Same-origin policy - Web security | MDN
Cross-origin network access. The same-origin policy controls interactions between two different origins, such as when you use XMLHttpRequest ...
Read more >
Cross-window communication - The Modern JavaScript Tutorial
When an iframe comes from the same origin, and we may access its document , there's a pitfall. It's not related to cross-origin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found