this post was submitted on 20 Apr 2024
8 points (72.2% liked)
Firefox
4436 readers
45 users here now
A community for discussion about Mozilla Firefox.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm not 100% sure about this, but I don't think addons are allowed to write anything to disk without user interaction, except to their own database of course.
I guess you could do it if you had some other installed software that backed up extension data from Firefox profile folder. Then again, if you are worried about some profile data getting wiped, then it would just make sense to back up the whole profile and not just little bits of it because who knows what other data could get wiped.
Tab Session manage can automatically backup sessions to the backup folder. I mentioned that on r/Firefox and got this response:
Oh, this is interesting. It does a backup-to-disk 30 seconds after startup.
During init() it schedules the backup with
setTimeout(backupSessions, 30000);
This generates a silent download to a predefined folder through the functions in these files:
https://github.com/sienori/Tab-Session-Manager/blob/master/src/background/background.js
https://github.com/sienori/Tab-Session-Manager/blob/master/src/background/backup.js
https://github.com/sienori/Tab-Session-Manager/blob/master/src/background/export.js
I didn't know setTimeout() worked in background scripts. If setInterval() works, too, then this could be done every 15 minutes or whatever interval would be sensible for user styles.
Huh, okay. That does seem like extensions can indeed write arbitrary data to default download directory automatically. Maybe you can create a feature request to existing extension for that kind of feature. Although I would think that an interval is totally unnecessary and it would make more sense to only make a backup whenever style editor is started or a style is otherwise being added/removed or some such.