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) {
    e.preventDefault();

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

    fetch('/my-api')
        .then(result => result.json())
        .then((result) => {
            newWindow.location.href = result.pdfUrl; // http://example.org/my-test.pdf 
            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.