Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
How to get the iframe element from the rendered content when domains are different?

The following iframe is embedded on https://third-party-site.com:

<iframe src="https://example.com/widget" />

https://example.com/widget is rendering dynamic content and I'd like to set iframe's height according to content's height to avoid having a scrollbar.

How could I get the iframe element from the widget page where the content is rendered?

window.frameElement unfortunately returns null because the domains are different:

If the window isn't embedded into another document, or if the document into which it's embedded has a different origin, the value is null instead.

Trying to access the iframe inside iframe's onload results in:

Uncaught DOMException: Blocked a frame with origin "https://third-party-site.com" from accessing a cross-origin frame.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!