You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
After further investigation I noticed that SVGSVGElement is fully compatible with saveSvgAsPng.
The only real problem is on the preliminary check: const isElement = obj => obj instanceof HTMLElement || obj instanceof SVGElement;
Of course [object SVGSVGElement] will fail the test.
I can't figure out what this object is instance of but adding a check on nodeName: const isElement = obj => obj instanceof HTMLElement || obj instanceof SVGElement || obj.nodeName == "svg";
Probably this is not the best way but makes the same code works for Firefox and Chrome.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hi,
I have in the HTML:
<object id="myid" data="mySvg.svg" height="100%" ></object>
Then, to get the element:
This works in Firefox but in Chrome I receive an error:
Error: an HTMLElement or SVGElement is required; got [object SVGSVGElement]
svgDom should be an Element...
I don't understand if it's my mistake, a browser problem or a problem with saveSvgAsPng. How can I solve the problem?
Thank you,
Riccardo
The text was updated successfully, but these errors were encountered: