Tengo una función muy simple que abre un archivo como se muestra en el ejemplo en mozilla
// fileHandle is a FileSystemFileHandle // withWrite is a boolean set to true if write async function verifyPermission(fileHandle, withWrite) { const opts = {}; if (withWrite) { opts.mode = 'readwrite'; } // Check if we already have permission, if so, return true. if (await fileHandle.queryPermission(opts) === 'granted') { return true; } // Request permission to the file, if the user grants permission, return true. if (await fileHandle.requestPermission(opts) === 'granted') { return true; } // The user did not grant permission, return false. return false; }pero sigo recibiendo un error que dice que file.queryPermission no es una función. Aquí está mi código:
let file = await window.showOpenFilePicker(); console.log(file.queryPermission({ mode: 'readwrite' })); También intenté poner console.log en un .then pero obtuve el mismo resultado.