I have same blob URL in two tags.
One tag has target="_blank" for opening the link in new tab and the other for downloading.
The "download" is fine but "Open in new tab" just works on Firefox. For Google Chrome, it keeps flashing, opens then closes immediately after clicking the link.
<a id="view" href="" target="_blank">View Blob in new tab</a>
<a id="download" href="" download="abc.txt">Download Blob</a>
<script>
$(function(){
var myBlob = new Blob(['Hello, I am Blob content'], {type: 'text/plain'})
var url = URL.createObjectURL(myBlob);
$("a#view").attr("href", url);
$("a#download").attr("href", url);
});
</script>
Is this a Google Chrome bug? (My Chrome version is: 54.0.2840.99 x64)
Live demo here:
The cause may be AdBlock. There is a discussion at StackOverflow here: Open blob objectURL in Chrome.
To disable AdBlock, click the AdBlock icon next to your location bar, then "Don't run on this page" or "Don't run on pages in this domain."