Complete collection of AI agent skills including: - Frontend Development (Vue, React, Next.js, Three.js) - Backend Development (NestJS, FastAPI, Node.js) - Mobile Development (React Native, Expo) - Testing (E2E, frontend, webapp) - DevOps (GitHub Actions, CI/CD) - Marketing (SEO, copywriting, analytics) - Security (binary analysis, vulnerability scanning) - And many more... Synchronized from: https://skills.sh/ Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
708 B
TypeScript
29 lines
708 B
TypeScript
/**
|
|
* StateManager - Manages extension active/inactive state with persistence.
|
|
*/
|
|
|
|
const STORAGE_KEY = "devBrowserActiveState";
|
|
|
|
export interface ExtensionState {
|
|
isActive: boolean;
|
|
}
|
|
|
|
export class StateManager {
|
|
/**
|
|
* Get the current extension state.
|
|
* Defaults to inactive if no state is stored.
|
|
*/
|
|
async getState(): Promise<ExtensionState> {
|
|
const result = await chrome.storage.local.get(STORAGE_KEY);
|
|
const state = result[STORAGE_KEY] as ExtensionState | undefined;
|
|
return state ?? { isActive: false };
|
|
}
|
|
|
|
/**
|
|
* Set the extension state.
|
|
*/
|
|
async setState(state: ExtensionState): Promise<void> {
|
|
await chrome.storage.local.set({ [STORAGE_KEY]: state });
|
|
}
|
|
}
|