I believe this is new in Safari Technology preview, but I could be mistaken: * Insert an `<object>` into the DOM, loading a PDF by the data attribute. * Remove that `<object>`. * Insert another `<object>` into the DOM, loading the same PDF by the data attribute. All subsequent times the object should be loaded, the embedded PDF viewer will not work. I have put together a minimal reproduction here: https://safari-pdf-issue.unstable.email/ Thanks!
This reproduces for me with macOS 12.5 beta. Looks like <object> gets a zero length PDF every time except the first load. document.getElementById("add").onclick = function () { const pdf = document.getElementById("pdf"); if (pdf) { pdf.parentNode.removeChild(pdf); } const newPdf = document.createElement("object"); newPdf.setAttribute("data", "/dummy.pdf"); newPdf.setAttribute("type", "application/pdf"); newPdf.setAttribute("id", "pdf"); document.body.appendChild(newPdf); }
<rdar://problem/94284319>