如何在Chrome扩展程序中获得2个图标 [英] How to get 2x favicon in Chrome extension

查看:93
本文介绍了如何在Chrome扩展程序中获得2个图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来 chrome:// favicon / 只允许我获得16x16的图标,并且在Retina屏幕中看起来很模糊。如果我想获得一个2x视网膜准备好的图标?

解决方案

这些网址应该可以工作:




  • 视网膜16px: chrome:// favicon / size / 16 @ 2x / http://www.apple.com/
  • 48px: chrome:// favicon / size / 48 / http://www.apple.com/



注意:


  • 某些版本的Chrome可能总是返回一个16x16的图标(或者是一个不完整的版本)。

  • 许多(大多数?)网站只提供16x16的图标,您无法做任何事情。 b $ b
  • 只有当相应的网页完全加载时,图标缓存才会获取图标。


It seems chrome://favicon/ only allows me to get a 16x16 favicon, and it looks blurry in Retina screens. What if I want to get a 2x retina ready favicon?

解决方案

These urls should work:

  • 16px for retina: chrome://favicon/size/16@2x/http://www.apple.com/
  • 48px: chrome://favicon/size/48/http://www.apple.com/

Notes:

  • Some versions of Chrome may always return a 16x16 icon (or a subpar stretched version).
  • Many (most?) sites provide only a 16x16 icon and there's nothing you can do about it.
  • The favicon cache gets an icon only when the corresponding web page is completely loaded.

这篇关于如何在Chrome扩展程序中获得2个图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆