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

119
Views
iPhone Safari Loads IFrame Blob with Pre Tags

I am having a weird issue. In Javascript, I am loading content from an external url, which is return a Blob, and then I am setting that blob to an Iframe's src. The code is this:

let url = 'https://www.example.com/';

let ifrm = document.createElement('iframe');

let xhr = new XMLHttpRequest();

                xhr.open('GET', url);
                xhr.onreadystatechange = function() {
                    if (this.readyState === this.DONE) {
                        if (this.status === 200) {
                            // this.response is a Blob, because we set responseType above
                            var data_url = URL.createObjectURL(this.response);
                            ifrm.setAttribute("src", data_url);
                        } else {
                            console.log(type);
                            console.log(url);
                            console.error('Unable To Set IFrame SRC');
                        }
                    }
                };

                xhr.responseType = 'blob';
                xhr.send();

The content inside the iframe renders correctly in every browser and OS: Windows, Mac Laptops, iPads, etc. But for some reason on iPhone, and only on the iPhone, it wraps all the content in a tag thus rendering actual html inside the iframe.

Does anyone have an idea why this is happening and how to fix?

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!