首页 > 解决方案 > svg 填充 url 不适用于任何 Chrome 扩展页面,但适用于任何网站和本地文件

问题描述

我正在使用我的 Chrome 扩展程序:zzllrr Imager Geek 并发现 svg 填充 url 在任何 Chrome 扩展程序页面中都不起作用(URL 以 chrome-extension:// 开头)。

但在普通网页(http:,https:, file://.)上,它就像一个魅力。下面是代码:

<svg id="LRectSq30821072" xmlns="http://www.w3.org/2000/svg" style="position: absolute; left: 66px; top: 155px; width: 76px; height: 76px; z-index: 2001; filter: none; transform: none;"> 
<defs> 
<linearGradient id="LRectSq30821072linearfill" x1="0%" y1="0%" x2="0%" y2="100%"> 
<stop offset="0%" style="stop-color:#3f377d;stop-opacity:1"></stop> 
<stop offset="34%" style="stop-color:#da310a;stop-opacity:1"></stop> 
<stop offset="68%" style="stop-color:#cd2c78;stop-opacity:1"></stop> 
<stop offset="100%" style="stop-color:#82a462;stop-opacity:1"></stop> 
</linearGradient> 
</defs> 
<rect x="1" y="1" width="74" height="74" stroke-width="2" stroke="#585c1a" stroke-opacity="1" fill="url(#LRectSq30821072linearfill)" fill-opacity="1" stroke-dasharray="" stroke-dashoffset="1" stroke-linecap="butt" stroke-linejoin="miter"></rect> 
</svg>

标签: svggoogle-chrome-extension

解决方案


推荐阅读