Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 Area-Undefined OS-Windows
New issue 162833 by
attek...@gmail.com: Loading new Blob constructed
PDF-file into iframe fails.
http://code.google.com/p/chromium/issues/detail?id=162833
Tested on:
OS: Window 7 x64
Chrome: 23.0.1271.91 (Official Build 167501) m and 25.0.1335.0 (169404)
canary
I have a html-page which has an iframe in it. I want to fetch a pdf-file
from server with a websocket connection and then load that file into the
iframe. On Linux the following javascript-snippet loads pdf-files into the
iframe but on Windows with the same script I can see from developer console
that the iframe has blob as a source but the file is not rendered and the
onload-event is not triggered. I can use the same javascript to load
html-files, mht-files etc. into the iframe with the right mime-type on both
Windows and Linux.
I tried with multiple different mime-types for the pdf-file but none of
them worked on Windows. 'text/pdf' gave the pdf-file content as a text into
the iframe but that doesn't help much.
And yes I have a really good reason to use this way of loading the
pdf-files into the browser.
javascript-snippet:
.
.
.
var target=document.getElementById('target')
target.src=(window.URL || window.webkitURL).createObjectURL(new
Blob([data],{type:'application/pdf'}))
.
.
.
the variable data is the binary-stream of the PDF-file conten from the
websocket-server.
HTML:
<html>
<head>
<script>
...Javascript...
</script>
</head
<body>
<iframe id='target' width=100% height=1000
onload=setTimeout(fetchNext,300)></iframe>
</body>
</html>