file opener for firefox? (js)

Viewed 22

I've built an app to open up one of my hard drives and display its contents on a page. Unfortunately, it doesn't work for Firefox because either the window.showDirectoryPicker() or the 'contextmenu' event listener isnt supported by Chrome. Does anyone know any other way to access files via Js/React?

This is the code I currently am using to do so:

const openFileButton = document.querySelector('.btn-three');
const table = document.querySelector('.table');
const specific_table = document.querySelector('.table1');

window.addEventListener('contextmenu', (event) => {
    event.preventDefault()
});

openFileButton.onclick = async() => {
    const dirHandle = await window.showDirectoryPicker(); 
0 Answers
Related