[Feature] Sync with local directory
Motivation I keep my dotfiles in a local directory on my filesystem, using Git to version-control them. I would like to include my userscripts in that local directory and have them synced to/from Violentmonkey.
Proposed Solution An additional "Sync to" option that supports syncing to a directory on the local filesystem.
Use Cases Mentioned above.
Extensions can't access local files in Firefox directly. In Chrome it requires either granting the extension access to the entire file system, which is unsafe, or using the new API. Both methods don't have an API to watch for changes, so we would have to poll the directory regularly, which is ineffective.
The only sane current workaround is nativeMessaging API and an external app that uses the system's built-in API to watch file changes, which is a complication we didn't want to add for such edge cases.
AFAIK, you can use a local WebDAV server for this task.
Yes, that would work, but running a WebDAV server comes with extra overhead. With the File System API, browsers can read and write to the local filesystem without needing an intermediary (like a local WebDAV server).
We won't use the native File System API, see what I wrote in my comment:
Both methods don't have an API to watch for changes, so we would have to poll the directory regularly, which is ineffective.
We won't use the native File System API, see what I wrote in my comment:
My bad, I opened the GitHub notification and it obscured your first comment.
I'm bad at reading too. I thought you wanted to have a direct link between local files and scripts the way it's imitated in Tampermonkey via @require file://
We can certainly add a new method to our sync, which you will trigger manually or on schedule.
This would be fantastically useful.