I just need a page to view pdf files in a Firefox browser. The files will be in any folder at my choosing. Kinda like what Firefox already does (like the picture attached), but a like to do this: when a select the file, the pdf pages are show to the right side. Sorry if it's too much to ask, but I couldn't find anything online, and I'm just starting to code, and I don't know how to do it...
I tried to do it with the code below... It didn't work...
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Visualizador PDF</title>
<style>
css
body, html {
height: 100%;
margin: 0;
font-family: Arial, sans-serif;
}
.container {
display: flex;
height: 100%;
}
.lista {
width: 30%;
overflow-y: auto;
border-right: 1px solid #ccc;
padding: 10px;
}
.visualizador {
width: 70%;
padding: 10px;
}
</style>
</head>
<body>
ok
<div class="container">
<div class="lista">
<ul id="listaArquivos">
<script>javascript
document.addEventListener('DOMContentLoaded', function() {
const listaArquivos = document.getElementById('listaArquivos');
const pdfViewer = document.getElementById('pdfViewer');
// Ajuste o caminho para a pasta pdfs localizada na sua área de trabalho
const diretorio = "file:///C:/Users/F170593/Desktop/pdfs/"; // Atualize com seu nome de usuário
fetch(diretorio).then(response => response.text()).then(text => {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(text, "text/html");
const items = xmlDoc.querySelectorAll('a'); // Use querySelectorAll para obter todos os links
items.forEach(item => {
const nomeArquivo = item.textContent;
if (nomeArquivo.endsWith('.pdf')) {
const li = document.createElement('li');
li.textContent = nomeArquivo;
li.addEventListener('click', function() {
pdfViewer.src = diretorio + nomeArquivo;
});
listaArquivos.appendChild(li);
}
});
});
});
</script>
</ul>
</div>
<div class="visualizador">
<iframe id="pdfViewer" width="100%" height="100%" src="" frameborder="0"></iframe>
</div>
</div>
</body>
</html>

When accessing files in Windows, then MS Edge has a system access advantage over other browsers as you can split the screen and open system folders in one half and use the other for viewing files such as ePub or PDF.
Here I am viewing #47 and you can see I am in the middle dragging 48.pdf to view that next.
You can start the process in a given folder from a shortcut
"C:\Program Files\Microsoft\Edge\Application\msedge.exe" %userprofile%/documentsor simpler drag the starting folder into MS Edge
Multiple tabs or multiple Dual Windows no problem.