Charlie’s post on browser storage (https://groups.google.com/g/tiddlywiki/c/l-1YLy0xpJo/m/mreI115qAgAJ) prompted me to post a reminder about the official browser-storage plugin. Charlie is exploring many interesting use cases for browser storage, but that particular post covers the same functionality as the browser-storage plugin.
The browser-storage plugin automatically writes any modified tiddlers to browser storage. It only writes tiddlers that match a filter, which one can set to [all[]] to save all tiddlers, or something like [prefix[$:/state/]] -[prefix[$:/state/popup/]] to just save state tiddlers.
At startup, the browser-storage plugin reads tiddlers from local storage. Any tiddlers that are identical to those built into the file are deleted from local storage. Once the wiki is up and running, any tiddler changes are written straight to local storage.
To try it out:
- Visit https://tiddlywiki.com/editions/full/#%24%3A%2Fplugins%2Ftiddlywiki%2Fbrowser-storage
- Click on the “settings” tab of the plugin
- Scroll down to the heading “Save Filter”, and change it to “[all[]]”
- Create or modify some tiddlers
- Refresh the page
- Observe how the changes are restored
As discussed in the plugin readme, there are some gotchas with browser storage, but it can still be useful in many situations.
Best wishes
Jeremy.