Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chrome console print picture 2018
(function(c) {
c.image = function(t) {
var img = new Image;
img.src = t;
img.onload = function (){
var style = [
"padding:" + Math.floor(img.height / 2) + "px " + Math.floor(img.width / 2)+ "px",
"background: url("+ encodeURI(t) +")",
"color: transparent",
"font-size:0",
].join(';');
console.log('%c.', style);
}
}
})(console);
console.image("https://github.com/ouweiya/ouweiya.github.io/blob/master/my-blog/chrome1.png?raw=true");
@ouweiya

This comment has been minimized.

Copy link
Owner Author

ouweiya commented Sep 20, 2018

c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.