Security error in Firefox WebExtension when trying getUrl image

落爺英雄遲暮 提交于 2019-12-12 03:27:01

问题


Trying to port some Chrome extension and getting this Security Error: Content at "http://example.com" may not load or link to "moz-extension://04d69802-c26f-47ae-86f2-d54650455e5a/blocks/indicators/__icon/indicators__icon-tweet.png"

(function () {
  'use strict';
   var PATHS = {
    TWITTER: chrome.extension.getURL("blocks/indicators/__icon/indicators__icon-tweet.png")
   };
})();

In manifest.json this path is in web_accessible_resources.


回答1:


To get rid of this error, full path should be provided.

"web_accessible_resources": [
   "blocks/indicators/__icon/indicators__icon-tweet.png"
]

No "blocks/indicators/*.



来源:https://stackoverflow.com/questions/36960630/security-error-in-firefox-webextension-when-trying-geturl-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!