Following up from a conversation in <https://github.com/w3c/FileAPI/issues/82>, we should apply the MIME type sniffing algorithm when navigating to a blob URL. Currently we do not implement support for content sniffing for blob URLs. When navigating to a blob URL that does not have a type (content-type) we start a download because we do not apply the MIME type sniffing algorithm as part of step 4 of the "process a navigate response" algorithm in the HTML standard: <https://html.spec.whatwg.org/#process-a-navigate-response> (2 June 2017). Instead we should apply the MIME type sniffing algorithm. Note WebKit defers to the underlying network stack (CFNetwork) to implement content sniffing. Unless we move such content sniffing into WebCore, we may need new API/SPI to access the content sniffing algorithm in the underlying network stack. Example: Open a page with the following markup: <!DOCTYPE html> <html> <body> <script> var frame = document.createElement("iframe"); frame.src = URL.createObjectURL(new Blob(["<h1>Hello</h1>"])); document.body.appendChild(frame) </script> </body> </html> Then you should see "Hello" (rendered as HTML) in the frame. But in Safari Version 10.1 (12603.1.24) we initiate a download.
<rdar://problem/32544847>