简体   繁体   English

如何设置Safari浏览器按钮图标?

[英]How can I set a Safari Browser button icon?

I am trying to set the icon in my Crossrider extension using appAPI.browserAction.setResourceIcon (see code) but it does not work. 我正在尝试使用appAPI.browserAction.setResourceIcon(请参见代码)在Crossrider扩展中设置图标,但是它不起作用。 What am I doing wrong? 我究竟做错了什么?

appAPI.ready(function($) {
 appAPI.browserAction.setResourceIcon('buttonIcon.jpg');
});

Unlike other browsers, Safari uses the extension's icon as the image for the button as noted in the Crossrider docs and quoted here for your convenience: 不像其他的浏览器,Safari浏览器使用分机的图标作为作为按钮的图像注意在Crossrider文档和这里引述为您提供方便:

  • Unlike other browsers that use setResourceIcon, the Safari button icon uses the default extension icon as set in the IDE ( Settings > General Settings ). 与其他使用setResourceIcon的浏览器不同,Safari按钮图标使用在IDE中设置的默认扩展名图标( “设置” >“ 常规设置” )。
  • For optimal appearance, the icon must be 128x128 pixels with resolution 72dpi. 为了获得最佳外观,图标必须为128x128像素,分辨率为72dpi。
  • Once set, the icon cannot be changed. 设置后,该图标将无法更改。
  • All transparent pixels are rendered in white and all other pixels are rendered in black. 所有透明像素均以白色呈现,而所有其他像素均以黑色呈现。 Hence, icons that do not have any transparent pixels appear as a black square. 因此,没有任何透明像素的图标显示为黑色正方形。

[ Disclosure : I am a Crossrider employee] [ 披露 :我是Crossrider员工]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM