Javascript 为什么赢了';在chrome扩展中不加载SVG吗?
我正在使用chrome扩展将一些HTML注入网站。在这段代码中,我包含了一个SVG。但当我加载网站时,我会Javascript 为什么赢了';在chrome扩展中不加载SVG吗?,javascript,svg,google-chrome-extension,content-script,Javascript,Svg,Google Chrome Extension,Content Script,我正在使用chrome扩展将一些HTML注入网站。在这段代码中,我包含了一个SVG。但当我加载网站时,我会 Failed to load resource: the server responded with a status of 404 (Not Found) http://stackoverflow.com/questions/SVG/home-outline.svg 我所有的svg文件都在一个名为svg的文件夹中。我正在加载带有“web\u可访问的\u资源”:[“SVG/*.SVG”]
Failed to load resource: the server responded with a status of 404 (Not Found) http://stackoverflow.com/questions/SVG/home-outline.svg
我所有的svg文件都在一个名为svg的文件夹中。我正在加载带有“web\u可访问的\u资源”:[“SVG/*.SVG”]
的SVG文件,因为我已经加载了其他文件。为什么我的图像无法加载
<span class="menu_T">
<button class="large_menu_button_T">
<img src="SVG/home-outline.svg">
</button>
</span>
当我尝试通过css背景添加svg时,我得到了相同的结果。在注入的代码中,类似于
“svg/home outline.svg”
的相对路径指向要注入的站点
您需要扩展中资源的完整路径。很容易得到它: