@@ -99,7 +99,7 @@ class MainBackground {
99 constructor() {
99 constructor() {
101 this.messagingService = new BrowserMessagingService();
101 this.messagingService = new BrowserMessagingService();
102− this.storageService = new BrowserStorageService();
102+ this.storageService = new MemoryStorageService();
103 this.logService = new ConsoleLogService(false);
103 this.logService = new ConsoleLogService(false);
104 this.stateMigrationService = new StateMigrationService(
104 this.stateMigrationService = new StateMigrationService(
105 this.storageService,
105 this.storageService,
@@ -172,34 +172,28 @@ class MainBackground {
175−
175+class MemoryStorageService {
176−class BrowserStorageService {
176+ storage = {};
180− this.storage = window.localStorage;
183 async get(key) {
178 async get(key) {
184− return JSON.parse(this.storage.getItem(key))
179+ return this.storage[key]
187 async has(key) {
182 async has(key) {
188− return this.storage.getItem(key) != null;
183+ return key in this.storage;
191 async save(key, obj) {
186 async save(key, obj) {
192 if (obj == null) {
187 if (obj == null) {
193− // Fix safari not liking null in set
188+ this.remove(key)
194− this.storage.removeItem(key)
198− this.storage.setItem(key, JSON.stringify(obj));
192+ this.storage[key] = obj
201 async remove(key) {
195 async remove(key) {
202− this.storage.removeItem(key)
196+ delete this.storage[key]