From d740603c75d7d6b60a46cbca99ddf7f0961e69b1 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Tue, 10 Mar 2026 17:59:12 -0700 Subject: [PATCH] Feat: Add vite config with web-extension plugin --- vite.config.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 vite.config.js diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..79558fb --- /dev/null +++ b/vite.config.js @@ -0,0 +1,54 @@ +import { defineConfig } from 'vite'; +import webExtension from 'vite-plugin-web-extension'; + +const target = process.env.TARGET || 'firefox'; + +export default defineConfig({ + build: { + outDir: `dist/${target}`, + emptyOutDir: true, + }, + plugins: [ + webExtension({ + manifest: () => { + const base = { + name: "in\u00D8sight", + version: "2.1.0", + author: "planetrenox@pm.me", + homepage_url: "https://github.com/planetrenox/inzerosight", + description: "Communicate undetected in plain sight.", + icons: { "48": "icon_500.png" }, + }; + + if (target === 'chrome') { + return { + ...base, + manifest_version: 3, + action: { + default_icon: "icon_500.png", + default_title: "in\u00D8sight", + default_popup: "index.html", + }, + }; + } + + return { + ...base, + manifest_version: 2, + browser_action: { + browser_style: false, + default_icon: "icon_500.png", + default_title: "in\u00D8sight", + default_popup: "index.html", + }, + content_security_policy: "script-src 'self'; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com;", + browser_specific_settings: { + gecko: { + id: "{0a73f41c-c59c-404b-9e07-f7392fa830d4}", + }, + }, + }; + }, + }), + ], +});