问题描述
大约一年前,我创建了一个插件来增强控制台日志,主要思想是在控制台中打印图像,例如,您可以添加一些图标或字形.
About year ago i created a plugin to enhance console logs, main idea was to print images in console, so for example You could add some icons or glyphs.
工作非常好,我看到现在有很多在线可用的产品.问题在于它们都不在atm上工作.
It was working pretty nice, i saw that there is many of those available online right now. The problem is that none of them are working atm.
我认为上次Chrome更新后发现了它.目前,我的版本为 49.0.2623.112
.
I noticed it after last chrome update i think. currently i have version 49.0.2623.112
.
所有这些插件(包括我的插件)都以相同的方式工作:
All of those plugins including mine works in the same way:
console.log("%c" + dim.string, dim.style + "background: url(" + url + "); background-size: " + (this.width * scale) + "px " + (this.height * scale) + "px; color: transparent;");
例如以下示例: github上的插件链接
有人知道我们如何在控制台中使用较新版本的chrome打印图像吗?
Does anyone know how we can print images in console in newer versions of chrome ?
推荐答案
使用控制台F12尝试一个代码示例:
Try a code example with console F12:
console.log('%c ', 'font-size:400px; background:url(https://pics.me.me/codeit-google-until-youfinda-stackoverflow-answerwith-code-to-copy-paste-34126823.png) no-repeat;');
这篇关于谷歌浏览器控制台,打印图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!