Skip to content

Commit

Permalink
Merge branch 'main' into issue-OWASP-BLT#1338
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Oct 28, 2023
2 parents b3adda8 + 22ddc4a commit b800702
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions website/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,17 @@ <h2 class="text-2xl font-semibold leading-7 text-gray-900">

function previewFile(file_name) {
event.preventDefault();
if (!screenshots || !(screenshots instanceof HTMLInputElement) || !screenshots.files || !screenshots.files.length) return;
Array.from(screenshots.files).map(file => {
if (file.name == file_name) {
let src = URL.createObjectURL(file);
$("#image-preview").attr("src", src);
if (file.name === file_name && file.type.startsWith('image/')) {
let src = URL.createObjectURL(file);
// Set the src attribute for the image preview
$("#image-preview").attr("src", src).on('load', function() {
URL.revokeObjectURL(src); // Revoke the blob URL after it's used
});
$("#image-preview-wrapper").css("display", "flex");
}
})
});
}

$("#image-preview-wrapper").on("click", () => {
Expand Down

0 comments on commit b800702

Please sign in to comment.