Estoy teniendo un problema extraño. En Javascript, estoy cargando contenido desde una URL externa, que devuelve un Blob, y luego configuro ese blob en un src de Iframe. El código es este:
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();El contenido dentro del iframe se muestra correctamente en todos los navegadores y sistemas operativos: Windows, computadoras portátiles Mac, iPad, etc. Pero, por alguna razón, en el iPhone, y solo en el iPhone, envuelve todo el contenido en una etiqueta, lo que representa el html real dentro del iframe. .
¿Alguien tiene una idea de por qué sucede esto y cómo solucionarlo?