Google Chrome can not open blob in new tab

33,145

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."

Share:
33,145

Related videos on Youtube

The Anh Nguyen
Author by

The Anh Nguyen

Hi! After graduated Hanoi University of Science and Technology, worked for BKAV(a famous Vietnam company about Anti-virus and Internet Security) and DeNA Hanoi(a company about games) Now, I'm an Software Engineer in Tokyo. Nice to meet all of you! https://www.linkedin.com/in/daubac402

Updated on July 22, 2022

Comments

  • The Anh Nguyen
    The Anh Nguyen 5 months

    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:

    https://jsfiddle.net/fa0kstm5/

    • Deepa
      Deepa over 5 years
      the demo link you provided is working fine in chrome at my end and this is the new tab link : blob:fiddle.jshell.net/1ada3411-bfba-461d-83cf-ebfe301e02d8. Try it on chrome Version 58.0.3029.110
    • Pete
      Pete over 5 years
      worked fine for me in chrome - opened in a new tab
    • The Anh Nguyen
      The Anh Nguyen over 5 years
      Thanks guys, I've tested in other PC. It's ok. So maybe My PC's Chrome has something wrong.
    • Chrysus
      Chrysus over 5 years
      No, this has been occurring for us lately as well. We have a new tab open programmatically at the beginning of a process, then a blob URL is later set to it. This previously worked fine in both Chrome and Firefox, but now it is only working in Firefox. Currently trying to find a solution as this causes issues for our clients and we've had to forego the blob tab which offers us more flexibility in what we do...
    • clabe45
      clabe45 about 5 years
      It doesn't work on my Chrome 61.0.3163.100 x64, but when I stop AdBlock on jsfiddle, it works fine, as @Raffi said.
  • The Anh Nguyen
    The Anh Nguyen about 5 years
    Thanks, I tried to disable adBlock for this page then retry. It's ok now.
  • Lea Verou
    Lea Verou almost 5 years
    Thank you so much! I would have never guessed that. You saved the day!