1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 19:39:57 +00:00
TiddlyWiki5/plugins/tiddlywiki/browser-storage
btheado 8a9d48e055
Allow browser storage plugin to delete existing tiddlers (#6625)
* Do not remove localstorage items while looping

While looping over all the browser storage items by index, the items
should not be removed because removing alters the index positions. The
item following the removed one will be skipped by the loop.

Instead, accumulate a list of keys to remove and remove them after the
loop.

* Implement full delete support for browser storage plugin

Before, deletes only worked for tiddlers which are only present in the
localstorage. Now deleted tiddlers are marked in localstorage using an
empty string value.

At startup, the localstorage tiddlers with empty strings will be deleted
from the wiki if they are still present. If they are already gone from
the wiki, then the blank localstorage entry will be deleted.

* Document drawbacks to using '[all[]]' and provide an alternative
2022-04-12 22:11:37 +01:00
..
config Browser-storage plugin: Don't save popup state by default 2020-02-19 18:58:13 +00:00
icon.tid BrowserStorage: Add startup log and fix save filter 2019-02-07 17:59:55 +00:00
plugin.info Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
rawmarkup.js Allow browser storage plugin to delete existing tiddlers (#6625) 2022-04-12 22:11:37 +01:00
rawmarkup.tid BrowserStorage: A new plugin to save tiddlers to local storage 2019-02-03 12:51:15 +00:00
readme.tid Allow browser storage plugin to delete existing tiddlers (#6625) 2022-04-12 22:11:37 +01:00
settings.tid Allow browser storage plugin to delete existing tiddlers (#6625) 2022-04-12 22:11:37 +01:00
startup.js Allow browser storage plugin to delete existing tiddlers (#6625) 2022-04-12 22:11:37 +01:00

title: $:/plugins/tiddlywiki/browser-storage/readme

This plugin enables TiddlyWiki to save tiddlers in [[browser local storage|https://en.wikipedia.org/wiki/Web_storage#localStorage]]. This means that changes are stored within the browser, and automatically re-applied any time the base wiki is reloaded.

At startup, the 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.

Browser local storage is not a panacea for TiddlyWiki:

* Browsers limit the amount of local storage available to a page, typically to 5 or 10MB
* Keeping personal data in browser local storage can lead to unexpected privacy violations
* Browsers reserve the right to without warning delete data stored in local storage at any time
* Browsers tie local storage to a URL which can lead to problems if you move a wiki to a URL previously occupied by a different wiki

Please use this plugin with caution. There are a number of unresolved issues and open questions:

* Innerwikis read the local storage of their parent wikis
* This plugin does not interfere with the existing saver mechanism, so you'll still get warnings when refreshing the page, even if your changes are safely committed to local storage
* There is a possibility that tiddlers might be transferred between different wikis if they are accessed via the same URL. This is particularly likely when running in local client server configuration under Node.js