gpt4 book ai didi

javascript - 在文件夹上接收 EntryChangedEvent

转载 作者:行者123 更新时间:2023-11-30 10:11:27 27 4
gpt4 key购买 nike

目前我正在使用 chrome.fileSystem-Api 进行实验,我对第 38 版中添加的新 EntryChangedEvent 感到好奇。但我正在写作是因为我真的不知道如何在我的应用程序中接收此事件。我这样试过,显然没有用:

chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(folder) {
if (!folder) {
output.textContent = 'No Folder selected.';
return;
}
folder.on("entrychangedevent",function(v){
console.log(v);
});
});

我必须如何更改我的代码才能真正使用接收 EntryChangedEvents?谢谢!

文档链接: https://developer.chrome.com/apps/fileSystem#type-EntryChangedEvent

最佳答案

我实际上认为这个功能还没有实现。我不知道为什么它在文档中,但是如果你查看 chromium 源代码,就会有一个名为 chrome.fileSystem.observeDirectory 的函数(它有一个应该获取这些事件的回调)但是在查看实现时它只是说:

bool FileSystemObserveDirectoryFunction::RunSync() {
NOTIMPLEMENTED();
error_ = kUnknownIdError;
return false;
}

我找到了这个文档,它是对 API 的请求:

https://docs.google.com/document/d/1aW-37JOBZgoD2CIPvoBEgw6bog8gFSowpfqtDEKt5Vo/edit#heading=h.w8inspeo32bj

无论如何,很棒的功能,可能很快就会可用。

关于javascript - 在文件夹上接收 EntryChangedEvent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26410189/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com