大约一年前,我创建了一个插件来增强控制台日志,主要思想是在控制台中打印图像,例如您可以添加一些图标或字形。
它工作得很好,我看到现在网上有很多这样的东西。问题是他们都没有自动取款机。
我想是在上次 chrome 更新后注意到的。目前我有版本49.0.2623.112
.
所有这些插件(包括我的)都以相同的方式工作:
console.log("%c" + dim.string, dim.style + "background: url(" + url + "); background-size: " + (this.width * scale) + "px " + (this.height * scale) + "px; color: transparent;");
例如这个:github上的插件链接 https://github.com/adriancooney/console.image/blob/master/console.image.js
有谁知道我们如何在新版本的 chrome 中在控制台中打印图像?
使用控制台 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;');
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)