function showPDF(pdfUrl) {
var iframe = document.getElementById("pdfFrame");
iframe.style.display = "block";
iframe.src = pdfUrl;
document.getElementById("fullscreenButton").style.display = "block";
iframe.scrollIntoView({
behavior: 'smooth',
block: 'start',
});
}
function openNewWindow() {
var iframe = document.getElementById("pdfFrame");
var pdfUrl = iframe.src;
window.open(pdfUrl, '_blank');
}
pdf links are in the list with name pdfList.
<a class="pdf-link" href="#" onclick="showPDF('https://www.africau.edu/images/default/sample.pdf')">pdf</a>
when i right click and open in new tab it opens the same page not the pdflink
Remove the script and let the browser handle it as it is supposed to.
Now you can left click to open in new tab and right-click to do whatever else you want (including open in a new tab)