Initialer Commit von lokal

This commit is contained in:
Florian Otto
2026-04-15 12:19:50 +02:00
commit 39874a619e
33 changed files with 1505 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// util/storage.js
// Speichert beliebige Daten in chrome.storage.local
async function saveToStorage(key, value) {
const data = {};
data[key] = value;
return chrome.storage.local.set(data);
}
// Holt Daten aus chrome.storage.local
async function loadFromStorage(key) {
const result = await chrome.storage.local.get(key);
return result[key];
}
// Löscht einen bestimmten Schlüssel aus dem Storage
async function removeFromStorage(key) {
return chrome.storage.local.remove(key);
}
// Löscht ALLE gespeicherten Daten (zurücksetzen)
async function clearStorage() {
return chrome.storage.local.clear();
}