I’m trying to print a PDF document without opening it. I found a guide on MDN that explains how this can be done.
const handleClick = (
event: React.MouseEvent<HTMLButtonElement, MouseEvent>,
) => {
event.stopPropagation();
event.preventDefault();
const frame = document.createElement('iframe');
frame.onload = () => {
frame.contentWindow.print();
};
// frame.style.display = 'none';
frame.src = docflow.primaryDocumentPdfUrl;
document.body.appendChild(frame);
};
In Chrome everything works well, but in Firefox an error occurs (see below).
Partitioned cookie or storage access was provided to
“http://localhost:3000/api/documents/5bf1c493-b8ce-4f82-9ee0-def28065c645/visualization”
because it is loaded in the third-party context and dynamic state
partitioning is enabled
Storage tab screenshot:
Guide is wrong or am I doing wrong?