Print result of new window location change

I want to create a new window which url is fetched async by a fetch/ajax request and show its print dialog directly without getting a popup error.

My code looks like this:

onSubmit(e) {

    // Need to create window here because inside the result you would get a popup error
    const newWindow ='', '_blank');

        .then(result => result.json())
        .then((result) => {
            newWindow.location.href = result.pdfUrl; // 
            newWindow.print(); // this seems to print blank page because the pdf is not yet loaded?

Solutions I tried did only work on Chrome on Desktop but not on Firefox or Safari.