I am getting this error:
Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLObjectElement': Blocked a frame with origin "http://localhost:8089" from accessing a cross-origin frame.(…)
when i try to access the height and width using content document:
var doc = document.getElementsByTagName("object")[0].contentDocument;
var size = doc.documentElement.getBoundingClientRect();
this._imageW = size.width;
this._imageH = size.height;
this works whena a user loads local files from their computer but not remote url.
i tried using jquery:
this._svg.addEventListener('load',function() {
this._imageW = jQuery(".SVGImage").width();
this._imageH = jQuery(".SVGImage").height();
...
...
it doesnt work on the first load of the image but it works for the second load of the images.
i want a way to access content document for URL inputs (images) how can i access the getBoundingClientRect() method of an svg image loaded as URL?