Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto
Something went wrong. Try again.
928 B · 19 lines
TypeScript
1234567891011121314151617181920// Which build of the extension is running. The dev channel is not a separate// extension — same id, same key, same OAuth redirect URI — so the only thing// that marks it at runtime is what scripts/dev-channel.mjs writes into the// built manifest: inverted icons, and this suffix on the name.//// Read back from the manifest rather than baked in with a build-time define,// because the suffix is applied *after* the bundle is written (a writeBundle// hook in vite.config.ts), and a watch rebuild patches dist/ the same way.
/** What scripts/dev-channel.mjs appends to the name; asserted equal in the test. */export const DEV_NAME_SUFFIX = ' (dev)'
/** * True in an unpacked dev-channel build, false in the store release. Dev-only * affordances (the popup's debug menu) hang off this. */export function isDevChannel(name = chrome.runtime.getManifest().name): boolean { return name.endsWith(DEV_NAME_SUFFIX)}