function readFile(entry, successCallback, errorCallback) {
entry.file((file) => {
let reader = new FileReader();
reader.onload = () => {
successCallback(reader.result);
};
reader.onerror = () => {
errorCallback(reader.error);
};
reader.readAsText(file);
}, errorCallback);
}FileSystemFileEntry: file() method / notebook
FileSystemFileEntry: file() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.