1
0
mirror of https://github.com/koloml/philomena-tagging-assistant.git synced 2026-05-09 15:12:21 +00:00

Added debug section to inspect extension's local storage

This commit is contained in:
2024-08-12 19:37:35 +04:00
parent f9cb73bafc
commit 68d1d726af
7 changed files with 189 additions and 0 deletions

19
src/stores/debug.js Normal file
View File

@@ -0,0 +1,19 @@
import {writable} from "svelte/store";
/**
* This is readable version of storages. Any changes made to these objects will not be sent to the local storage.
* @type {Writable<Record<string, Object>>}
*/
export const storagesCollection = writable({});
chrome.storage.local.get(storages => {
storagesCollection.set(storages);
});
chrome.storage.local.onChanged.addListener(changes => {
storagesCollection.update(storages => {
for (let updatedStorageName of Object.keys(changes)) {
storages[updatedStorageName] = changes[updatedStorageName].newValue;
}
})
});