Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda