Print.js icon indicating copy to clipboard operation
Print.js copied to clipboard

DOMException: Blocked a frame with origin

Open spidfire opened this issue 4 years ago • 5 comments

I got a problem with printing with the first few buttons on https://printjs.crabbly.com/ :

Console error:

Uncaught DOMException: Blocked a frame with origin "https://printjs.crabbly.com" from accessing a cross-origin frame.
    at u (https://printjs.crabbly.com/print.js?v1.5.0:1:4095)
    at HTMLIFrameElement.n.onload (https://printjs.crabbly.com/print.js?v1.5.0:1:5017)

I think it has to do with the

Browser details: http://supportdetails.net/50FRHNM4

spidfire avatar Jun 21 '21 09:06 spidfire

I've created a temporary workaround:

printJS({printable: printUrl, type: 'pdf', onError: (e) => {
                    let w = window.open(printUrl);
                    w.window.print();
                    w.document.close();
            }});

Maybe also an option as fallback for this library? You will lose some functionality though.

spidfire avatar Jun 21 '21 10:06 spidfire

Same problem for me

jchapelle avatar Jun 30 '21 11:06 jchapelle

I'm having the same problem as well. Also tried to download the examples on the website through my phone and got the same errors.

Risturbeat avatar Aug 18 '21 11:08 Risturbeat

Same problem for me

jayjliang avatar Sep 02 '21 12:09 jayjliang

Is there any updates on this issue ? Getting exactly same issue. https://codesandbox.io/s/print-i1zx2?file=/src/index.js

dhavaldeveloper avatar Sep 28 '21 00:09 dhavaldeveloper