JSFiddle - React, Tailwind, and code Playground

JavaScript

var frame = document.createElement('iframe');
var external_doc = new Blob(['<html><body><img src="https://78.media.tumblr.com/b90ee054017d4ddd25a4c4161127c7d4/tumblr_p8iyzdMhuZ1qzooxpo1_1280.jpg"></body></html>'], {
  type: 'text/html'
});
frame.onload = function() {
  try {
    this.contentWindow && this.contentWindow.print();
    return;
  } catch (e) {}
  console.error('in a protective iframe?');
};
frame.src = URL.createObjectURL(external_doc);
document.body.appendChild(frame);