const observer = new FileSystemObserver(callback);FileSystemChangeRecord / notebook
FileSystemChangeRecord
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const callback = (records, observer) => {
for (const record of records) {
console.log("Change detected:", record);
const reportContent = `Change observed to ${record.changedHandle.kind} ${record.changedHandle.name}. Type: ${record.type}.`;
sendReport(reportContent); // Some kind of user-defined reporting function
}
observer.disconnect();
};