Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ jobs:
- name: Build extension
working-directory: ./packages/extension
run: npm run build
env:
SET_EXTENSION_PUBLIC_KEY_IN_MANIFEST: 1
- name: Get extension version
id: get-version
working-directory: ./packages/extension
Expand Down
13 changes: 12 additions & 1 deletion packages/extension/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { viteStaticCopy } from 'vite-plugin-static-copy';

// Public key matching the Chrome Web Store listing — used to fix the extension ID across installs.
// Set SET_EXTENSION_PUBLIC_KEY_IN_MANIFEST=1 in release builds to inject it into the manifest.
const extensionPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwRsUUO4mmbCi4JpmrIoIw31iVW9+xUJRZ6nSzya17PQkaUPDxe1IpgM+vpd/xB6mJWlJSyE1Lj95c0sbomGfVY1M0zUeKbaRVcAb+/a6m59gNR+ubFlmTX0nK9/8fE2FpRB9D+4N5jyeIPQuASW/0oswI2/ijK7hH5NTRX8gWc/ROMSgUj7rKhTAgBrICt/NsStgDPsxRTPPJnhJ/ViJtM1P5KsSYswE987DPoFnpmkFpq8g1ae0eYbQfXy55ieaacC4QWyJPj3daU2kMfBQw7MXnnk0H/WDxouMOIHnd8MlQxpEMqAihj7KpuONH+MUhuj9HEQo4df6bSaIuQ0b4QIDAQAB';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
Expand All @@ -31,7 +35,14 @@ export default defineConfig({
},
{
src: '../../manifest.json',
dest: '.'
dest: '.',
...(!!process.env.SET_EXTENSION_PUBLIC_KEY_IN_MANIFEST ? {
transform: (content: string) => {
const manifest = JSON.parse(content);
manifest.key = extensionPublicKey;
return JSON.stringify(manifest, null, 2);
}
} : {})
}
]
})
Expand Down
Loading