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:
19
src/stores/debug.js
Normal file
19
src/stores/debug.js
Normal 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;
|
||||
}
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user