为什么我无法从chrome扩展程序获取图像文件?

问题描述 投票:0回答:1

到目前为止,我无法使用这样的方法调用我的图像。

哪里是我的错?

'<span style="width:100%;"><img src=' + chrome.extension.getURL('/images/load-data.gif') + '></span>'
javascript google-chrome-extension
1个回答
0
投票

wOxxOm解决

.gif格式添加到web_accessible_resources

{
  ...
  "web_accessible_resources": [
    "images/*.png",
    "images/*.gif",
  ],
  ...
}

谢谢。

© www.soinside.com 2019 - 2024. All rights reserved.