The content visible inside an SVG element depends on its aspect ratio, its viewBox and its preserveAspectRatio .
For example, the same size of an SVG element with the same viewBox value (red dotted bottom) may have different viewports (shown in blue below) depending on preserveAspectRatio :

Chrome has a viewport property, but for my purposes it is always an empty (all 0-digit) SVGRect. Firefox does not implement this property.
The svg.getBBox() method returns the value of viewBox , not the actual visible content of the viewport.
Given the link to the SVG element, how can I most easily determine the visible content (viewport) expressed in user coordinates in the root of the SVG (the same coordinates as the viewBox )?
source share