Hey,
I’m developing a frontend in Angular that gets the data form a rest api (other server/port) and i found a problem regarding the Image control.
No problem when getting the image, but when uploading a new image the response data ends in a iframe that is impossible to access due to CORS if the upload URL is not same host/port.
The error is
ERROR DOMException: Blocked a frame with origin "http://192.168.2.80:4200" from accessing a cross-origin frame.
at Object.doOnUpload (http://192.168.2.80:4200/assets/js/dhtmlx.js:56359:46)
at HTMLIFrameElement.c.childNodes.(anonymous function).onload (http://192.168.2.80:4200/assets/js/dhtmlx.js:56307:19)
at HTMLIFrameElement.wrapFn [as __zone_symbol___onload] (http://192.168.2.80:4200/polyfills.bundle.js:1071:39)
at ZoneDelegate.webpackJsonp.1041.ZoneDelegate.invokeTask (http://192.168.2.80:4200/polyfills.bundle.js:440:31)
at Object.onInvokeTask (http://192.168.2.80:4200/vendor.bundle.js:4499:37)
at ZoneDelegate.webpackJsonp.1041.ZoneDelegate.invokeTask (http://192.168.2.80:4200/polyfills.bundle.js:439:36)
at Zone.webpackJsonp.1041.Zone.runTask (http://192.168.2.80:4200/polyfills.bundle.js:207:47)
at HTMLIFrameElement.ZoneTask.invoke (http://192.168.2.80:4200/polyfills.bundle.js:502:38)
How can i avoid this?
I have read about ‘postMessage’, a method to transfer data across different domains, but it needs to modify the dhtmlx.js and i’m not sure how to proceed.