-
Notifications
You must be signed in to change notification settings - Fork 56
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
SQLite via OPFS for Chrome Extension isn't quite supported #352
Comments
The core ask here is to make the following feature detection return if (self instanceof ServiceWorkerGlobalScope && 'createSyncAccessHandle' in self.FileSystemFileHandle.prototype) {
// OPFS in `ServiceWorkerGlobalScope` (extension service worker) is supported!
} |
I think it makes sense that Option 1: Extension service worker supports
|
Yeah the inability to create a |
Adding
neutral: chrome
We're definitely excited about the idea of extensions using OPFS. With that in mind, we have just added a new reason to offscreen documents to allow spawning a worker: https://chromium.googlesource.com/chromium/src/+/a8fe947f9d5737f4e36fe32ab8fa851ea6da8865. This was in direct response to feedback about wanting to use the OPFS SQLite implementation in extensions. On the broader discussion of giving extensions access to spawning nested workers or Additionally, I promised in the last meeting to follow-up on why createSyncAccessHandle wasn't initially made available in service workers. To summarise:
|
While very exciting to see that Chrome has support for spawning workers from an offscreen document, what is concerning is that other browsers are going different routes. As far as we understand, both Safari and Firefox have not implement offscreen documents and Safari is going towards limited event pages instead. This fragmentation is very concerning from 1Password's point of view since these methods are very different and can affect the foundations of an extension. We're looking for a cross-browser single-codebase solution for adopting OPFS and SQLite. Is Safari and Firefox planing to support the same work-around as Chrome? |
I was surprised to learn that use of SQLite via OPFS in a Chrome Extension currently requires launching a dedicated html page. It evidently can't be invoked from a content.js or background.js file. The S/O Q&A is here and the Chrome Extension developer group Q&A is here. Addressing this issue would unlock many exciting local-first data-intensive use cases.
The text was updated successfully, but these errors were encountered: