Moonchild wrote: ↑2022-05-23, 07:29
I'm afraid you've gone about it the wrong way.
By what I will say next, I do not intend to contradict you. Your knowledge of the subject is far greater than mine. For me, making add-ons is a hobby (which started from a desire to solve some problems). Besides, I'm of an age where people are walking their grandchildren in the park, so I don't expect a bright future in programming
With that said, I'm going to present below the findings I've made, over time.
I've been using Pale Moon for several years now. Before that I used Firefox, also for many years. During this time, the number of "Bookmarks" kept growing until I ended up with the "places.sqlite" file now being 120 MB. Probably this is the reason why, for some time, the process "palemoon.exe" persists for a long time (in "Task Manager / Processes"), and it is frequent cases where this situation ends with the error message "Pale Moon web browser has stopped working".
- pale_moon_web_browser_has_stopped_working.png (17.09 KiB) Viewed 1357 times
Through tests, I noticed that this problem disappears permanently if I delete the "places.sqlite" file (120 MB), which is replaced by Pale Moon with a 10 MB file (without Bookmarks).
When I close Pale Moon after the error message "Pale Moon web browser has stopped working", all three "places.sqlite" files remain in the "Profiles" folder («sqlite database in a "dirty" state»). Although this situation has been repeated many times, I have never had any "Bookmark" missing.
The add-on I made saves the three "places.sqlite" files as soon as I press Pale Moon's "Close" button, before they are accessed by Pale Moon «(-shm and -wal are db "log" files used to update the final database when closed)». I found this visually, in a "file manager" that does not automatically sort modified (or added) files. This led me to assume that Pale Moon accesses these files only after the code in the add-on has already been executed: ".observe = function(event){...}". In this case, these files are not corrupted and Pale Moon should treat them as it treats them if it closes with the error "Pale Moon web browser has stopped working" (in which case I have never had any "Bookmark" missing). I have also tested this assumption ("no file corruption") and so far it has not been refuted.
I repeat what I said at the beginning of the post: I do not intend to contradict you. On the other hand, as long as the add-on doesn't corrupt the "places.sqlite" files, an additional method to mitigate the risk of losing Bookmarks doesn't hurt, especially since it is automated, being executed every time I close Pale Moon - no need to worry that I forgot to backup manually