-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#129 Draft - support for new fileHierarchy() function which adds a ha… #132
base: main
Are you sure you want to change the base?
#129 Draft - support for new fileHierarchy() function which adds a ha… #132
Conversation
… which adds a handle to the requested directory as well as the content of that directory
… which adds a handle to the requested directory as well as the content of that directory
I know this is still in flux. If we have nested empty folders, they should be listed, too. So for example, for a file hierarchy like this:
|
Currently your code would ignore the |
@tomayac Ah, that's interesting. The return type of directoryOpen, which is delegated to, is:
It looks like what we would want it to return instead is something like:
Given that this would be a breaking change for existing users, looks like I can no longer delegate to directoryOpen, and instead need to copy/paste and adjust for this function's need, agree? One question before working on the next round: I am not clear what the legacySetup portion is doing in the typescript definition; and, the linked to issue has been resolved in the meantime. Safe enough to remove this in the fileHierarchy version of this function? Thanks |
This would definitely need to be a new function, the existing function cannot be used, since it works entirely differently.
Luckily the legacy setup would not be something you'd have to deal with in this case, since you'd only deal with the modern API. The reason the legacy setup exists is that when you cancel an
|
If you're still working on this PR, the function at https://github.com/tomayac/opfs-explorer/blob/f86be0405bef6c68532be3a9fd347eab89e511a1/contentscript.js#L5-L48 may be 95% of what you're looking for. If you're interested in porting it here, please proceed. |
…ndle to the requested directory as well as the content of that directory.
(Not verified yet - submitted for code review.)