title: Open a text/html Blob in a new tab in safari
body: <p>I have a question regarding Blobs in Safari. I have the following function:</p>
  
  <pre><code>openTab = () =&gt; {
      if (this.printGrid) {
        const url = URL.createObjectURL(
          new Blob([this.wrapHTMLBody(this.printGrid.innerHTML)], { type: 'text/html;charset=utf-16' })
        );
        // eslint-disable-next-line
        window.open(url).print();
      }
    };
  </code></pre>
  
  <p>In Chrome this code opens a new Tab loads the innerHTML and then opens the print window. The opened HTML then looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ANsF1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ANsF1.png" alt="Picture showing the HTML output"></a></p>
  
  <p>Now when i run this in safari i get this:
  <a href="https://i.stack.imgur.com/hEGZj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hEGZj.png" alt="Image showing the HTML Output in Safary"></a></p>
  
  <p>So basically Safari wrapps my content into a  tag. Does anybody know why this is the case and if there is a way to work around it? I couldn't find a lot about this on the web. </p>
  
  <p>I could use file-saver js to save the html. But then the user would have to open the downloaded html and print it manually and that i am trying to avoid. Any help would be appreciated. </p>