1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-21 03:39:43 +00:00

Seperate clear cookie and disable actions in Browser Storage Plugin (#8602)

Added two messages:
* `tm-delete-browser-storage` for deleting the cookie saved by the
  Browser Storage plugin
* `tm-disable-browser-storage` for disabling Browser Storage
This commit is contained in:
Leilei332 2024-09-15 17:48:08 +08:00 committed by GitHub
parent c7ca8359ab
commit 3355907581
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,6 +54,13 @@ exports.startup = function() {
$tw.wiki.addTiddler({title: ENABLED_TITLE, text: "no"});
$tw.browserStorage.clearLocalStorage();
});
// Seperate clear cookie and disable action
$tw.rootWidget.addEventListener("tm-delete-browser-storage",function(event) {
$tw.browserStorage.clearLocalStorage();
});
$tw.rootWidget.addEventListener("tm-disable-browser-storage",function(event) {
$tw.wiki.addTiddler({title: ENABLED_TITLE, text: "no"});
});
// Helpers for protecting storage from eviction
var setPersistedState = function(state) {
$tw.wiki.addTiddler({title: PERSISTED_STATE_TITLE, text: state});