I got this error in safari while trying to convert svg to base64 url via code:
$svgCopy = $('svg').clone()
html = $('<div>').append($svgCopy).html()
imgSrc = 'data:image/svg+xml;base64,' + btoa(html)
imgEl.src = imgSrc
The problem is that when you set attribute with NS (setAttributeNS) safari sets NS\d+ namespace and do not sets xmlns:NS\d+ attribute in svg, so it looks like
<use NS1:href="#source" />
When you copy such svg in Chrome - you have not such problem because this svg element will look like this:
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#source" />
And in result (on svg copy) we getting invalid file.
UPD: @Robert with setAttributeNS
all is ok:
el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#source')
Without proper call it won't work in Chrome.