Open personalizedrefrigerator opened 7 months ago
Fixing this issue should also allow creating and manipulating resources with plugins (e.g. to create a voice recorder plugin, as requested here).
This would be great, as I have a plugin that requires access to note resources, and some people have suggested that I update the plugin to support the mobile platform, and the only block I have is this.
Operating system
Android/iOS
Joplin version
3.0
Mobile plugins: Provide file system and database access
Many of the plugins that fail to run on mobile do so because they lack file system access. Some need both access to an SQLite database (requested here) and access to the file system. To support these plugins on mobile, we should consider exposing these APIs.
Notes and considerations
fs
property on thejoplin
plugin object.fs
or to add a new Joplin API for file system access?fs
doesn't seem feasible, particularly with synchronous methods (all plugin IPC isasync
).localStorage
/indexedDB
?localStorage
andindexedDB
may be much faster than exposing the real file system (which is mostly app-private). It would also be more secure (and easier to clear all plugin-specific data).indexedDB
/localStorage
would make it difficult to load/store a SQLite database file. If we expose our database driver, users will be writing to the filesystem directly. We could alternatively expose a web-based SQLite database to plugins.localStorage
and the Origin-Private File System to store databases. This, however, would require bundling a large WASM file with the app.