disable tabs permission when not testing

This commit is contained in:
Tommy D. Rossi
2025-11-24 11:59:37 +01:00
parent 16b3aaca50
commit 2a9793bf9d
2 changed files with 26 additions and 8 deletions
+12 -1
View File
@@ -2,6 +2,7 @@ import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import fs from 'node:fs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
@@ -21,7 +22,17 @@ export default defineConfig({
},
{
src: resolve(__dirname, 'manifest.json'),
dest: '.'
dest: '.',
transform: (content) => {
const manifest = JSON.parse(content);
// Only include tabs permission during testing
if (!process.env.TESTING) {
manifest.permissions = manifest.permissions.filter((p: string) => p !== 'tabs');
}
return JSON.stringify(manifest, null, 2);
}
},
{
src: resolve(__dirname, 'welcome.html'),