Transfer von GitLab
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user