Popup is now calling the browser storage directly instead of using the messaging system. Should be a bit faster.
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
const storage = browser.storage.local;
|
||||
|
||||
export async function bglog(msg, module = null) {
|
||||
await browser.runtime.sendMessage({
|
||||
kind: 'log',
|
||||
payload: { msg, module },
|
||||
});
|
||||
}
|
||||
|
||||
export async function getProfileNames() {
|
||||
let profiles = await storage.get({ profiles: [] });
|
||||
return profiles.profiles.map(p => p.name);
|
||||
}
|
||||
|
||||
export async function getProfileIndex() {
|
||||
const index = await storage.get({ profileIndex: 0 });
|
||||
return index.profileIndex;
|
||||
}
|
||||
|
||||
export async function setProfileIndex(profileIndex) {
|
||||
await storage.set({ profileIndex });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user