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

135
Views
Cross-origin issue when updating the iframe's height. Content loads correctly

I have the following iframe:

<iframe style="width:100%;border:none;margin:100px 0px;" scrolling="no" src="https://seifti.io/document/policy/priva?l=es&c=f8ba59746ab55688799b9b16ebac73d749952ebcc5ae4d9d91d939d5c48f3baf" onload="this.style.height=this.contentWindow.document.documentElement.scrollHeight+'px'"></iframe>

The content loads correctly, but the following function that executes onload:

this.style.height=this.contentWindow.document.documentElement.scrollHeight+'px'

which aims to set the appropiate height of the iframe based on its content's length, provokes the following error on the browser:

Uncaught DOMException: Blocked a frame with origin "http://seifti.test" from accessing a cross-origin frame at HTMLIFrameElement.onload http://seifti.test/site/policy/privacy:222:317)

I do understand that the browser would not allow me to manipulate the iframe's content by using Javascript, but in this case I'm just trying to update it's height?

What would be the best workaround?

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!