Lesss gooo claude

This commit is contained in:
2026-09-06 11:44:59 +02:00
parent 477db87363
commit 9362c9ac80
22 changed files with 3871 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import { getLockState, setLockState } from '@/background/lock-state';
import type { NexaMessage } from '@/shared/messaging';
export default defineBackground(() => {
browser.runtime.onMessage.addListener((message: NexaMessage, _sender, sendResponse) => {
switch (message?.type) {
case 'nexa:get-lock-state':
getLockState().then(sendResponse);
return true; // keep the message channel open for the async response
case 'nexa:set-lock-state':
setLockState(message.state).then(() => sendResponse({ ok: true }));
return true;
case 'nexa:open-popup':
// Best-effort: not all browsers/contexts allow programmatic popup
// opening outside a direct user gesture on the action icon.
browser.action.openPopup().catch(() => undefined);
return false;
default:
return undefined;
}
});
});