From 8b530bc1c94b562574437fef613245a4d71a2bea Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 26 Apr 2026 18:58:58 -0700 Subject: [PATCH] fix: Use `manifestVersion` from CLI during manifest generation (#2306) --- packages/wxt/src/core/utils/manifest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/wxt/src/core/utils/manifest.ts b/packages/wxt/src/core/utils/manifest.ts index a36a164f..fef39fea 100644 --- a/packages/wxt/src/core/utils/manifest.ts +++ b/packages/wxt/src/core/utils/manifest.ts @@ -308,7 +308,7 @@ function addEntrypoints( options.theme_icons = popup.options.themeIcons; const actionKey = - manifest.manifest_version === 2 + wxt.config.manifestVersion === 2 ? (popup.options.actionType ?? 'browser_action') : wxt.config.browser === 'firefox' && popup.options.actionType === 'page_action' @@ -493,7 +493,7 @@ function addDevModeCsp(manifest: Browser.runtime.Manifest): void { const permission = `${permissionUrl}*`; const allowedCsp = wxt.server?.origin ?? 'http://localhost:*'; - if (manifest.manifest_version === 3) { + if (wxt.config.manifestVersion === 3) { addHostPermission(manifest, permission); } else { addPermission(manifest, permission); @@ -502,7 +502,7 @@ function addDevModeCsp(manifest: Browser.runtime.Manifest): void { const extensionPagesCsp = new ContentSecurityPolicy( // @ts-expect-error: extension_pages exists, we convert MV2 CSPs to this earlier in the process manifest.content_security_policy?.extension_pages ?? - (manifest.manifest_version === 3 + (wxt.config.manifestVersion === 3 ? DEFAULT_MV3_EXTENSION_PAGES_CSP : DEFAULT_MV2_CSP), );