Open dotproto opened 8 months ago
It might be possible to "re-base" it on the new File System Access API, which AFAIK uses a very similar API for File and Directory entries that are allowed in a service worker. As for the missing stuff that will need to be emulated or dropped, someone should look at the old FileSystem API and list them.
@dotproto Here's an update from Tim: https://chromium-review.googlesource.com/c/chromium/src/+/5112904
One other thing:
One note with that particular API though is that it's not exposed to service workers, but is available in other contexts (extension popup, web pages inside the extension, etc.).
That commit is unrelated and won't help because service workers don't have DOM, which is required by this API.
Sorry about that. I'm playing catchup, so moving a bit fast. Too fast, clearly.
In the future will runtime.getPackageDirectoryEntry() return a promise in Chrome?
Yes. This is done.
Does Chrome plan to support this method in service workers?
Not at any point in the near future.
I assume that Chrome didn't expose getPackageDirectoryEntry() in service workers because the DirectoryEntry interface isn't exposed in that context. If true, does Chrome have plans to enable extensions to access similar capabilities or data using an alternative API?
We're unlikely to add anything specifically for this. Depending on the use case, alternatives exist (e.g., if you just need file content, you can fetch() it).
This is a pretty old API that we've talked about removing in the past, but it has non-trivial usage.
Issue https://github.com/mdn/content/issues/2986 notes that the MDN documentation for
runtime.getPackageDirectoryEntry()
isn't accurate. In order to help resolve that documentation issue, I'd like to ask the Chrome team for clarification on a couple of questions.In the future will
runtime.getPackageDirectoryEntry()
return a promise in Chrome?Does Chrome plan to support this method in service workers?
I assume that Chrome didn't expose
getPackageDirectoryEntry()
in service workers because theDirectoryEntry
interface isn't exposed in that context. If true, does Chrome have plans to enable extensions to access similar capabilities or data using an alternative API?