add open in a new tab

This commit is contained in:
Mylloon 2025-02-07 18:57:19 +01:00
parent 9033c5c13d
commit 1714c06979
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -129,7 +129,14 @@ const blobifyPdfs = () => {
};
base64ToBlob(item.src.split(",")[1]).then((blob) => {
item.src = URL.createObjectURL(blob);
const newUrl = URL.createObjectURL(blob);
item.src = newUrl;
const link = document.createElement("a");
link.href = newUrl;
link.target = "_blank";
link.textContent = "Ouvrir le PDF dans un nouvel onglet";
item.insertAdjacentElement("afterend", link);
});
}
};