0

I tried to print iframe document with this code.

  const printReport = () => {
    window.frames['integration_report'].focus();
    window.frames['integration_report'].print();
  };

But the browser printed the error code for the print function.

DOMException: Blocked a frame with origin "http://localhost:8082" from accessing a cross-origin frame.

I solved the problem by adding the cross origin authority to the sandbox. But I still wonder why this authority is needed to print dom.

  • 3
    Does this answer your question? [SecurityError: Blocked a frame with origin from accessing a cross-origin frame](https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame) – Eldar B. Sep 17 '21 at 08:33

0 Answers0