0
到了这一步,我不能用这样的方法调用我的图像。为什么我无法从Chrome扩展中获取图像文件?
我的错误在哪里?
'<span style="width:100%;"><img src=' + chrome.extension.getURL('/images/load-data.gif') + '></span>'
到了这一步,我不能用这样的方法调用我的图像。为什么我无法从Chrome扩展中获取图像文件?
我的错误在哪里?
'<span style="width:100%;"><img src=' + chrome.extension.getURL('/images/load-data.gif') + '></span>'
解决通过wOxxOm
添加.gif
格式转换成web_accessible_resources
:
{
...
"web_accessible_resources": [
"images/*.png",
"images/*.gif",
],
...
}
感谢。
取决于你想要在哪里使用它。如果它位于网页上,则需要在[web_accessible_resources](https://developer.chrome.com/extensions/manifest/web_accessible_resources)中声明它。 – wOxxOm
哦,我只是添加PNG格式,而不是GIF。哈哈。谢谢。 – Ananda