Open Bug 1724903 Opened 3 years ago Updated 3 years ago

SVG tag USE and crossorigin symbols

Categories

(Core :: SVG, enhancement)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: alexander, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

Steps to reproduce:

I want to use an icon library from CDN. My icons are SVG sprites so I can control color with CSS. I try to use it like that:

<svg>
  <use href="https://my-cdn-url/icon.svg#symbol"></use>
</svg>

Actual results:

This works great on the same domain, but cross-origin requests by USE are forbidden.

Expected results:

There should be a way to allow this, like a crossorigin="anonymous" attribute that is used in similar situations.

Here's a Chromium bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=470601

And here's an SVG WG discussion regarding this case:
https://github.com/w3c/svgwg/issues/707

It appears that it is in consideration for the specs after SVG2 is finalized, but if it was to be implemented by major browsers it might be added to specs sooner.

Component: Untriaged → SVG
Product: Firefox → Core

We'd probably want to implement bug 1240357 first. That just needs tests writing for it and unbitrotting really.

You need to log in before you can comment on or make changes to this bug.