From 495c5c8e4c60f4dc8e913aab396027d6833b5c8e Mon Sep 17 00:00:00 2001 From: Aaron Klinker Date: Sun, 16 Jul 2023 11:29:34 -0500 Subject: [PATCH] fix: Read boolean maniest options from meta tags correctly --- e2e/tests/manifest-content.test.ts | 6 +++--- src/core/build/findEntrypoints.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e/tests/manifest-content.test.ts b/e2e/tests/manifest-content.test.ts index e99a2202..b17ca938 100644 --- a/e2e/tests/manifest-content.test.ts +++ b/e2e/tests/manifest-content.test.ts @@ -57,7 +57,7 @@ describe('Manifest Content', () => { const optionsContent = ` - + @@ -72,7 +72,7 @@ describe('Manifest Content', () => { const manifest = await project.getOutputManifest(); expect(manifest.options_ui).toEqual({ - open_in_tab: true, + open_in_tab: false, chrome_style: true, page: 'options.html', }); @@ -88,7 +88,7 @@ describe('Manifest Content', () => { ); expect(manifest.options_ui).toEqual({ - open_in_tab: true, + open_in_tab: false, browser_style: true, page: 'options.html', }); diff --git a/src/core/build/findEntrypoints.ts b/src/core/build/findEntrypoints.ts index 077e9209..b28ea7a5 100644 --- a/src/core/build/findEntrypoints.ts +++ b/src/core/build/findEntrypoints.ts @@ -162,21 +162,21 @@ async function getOptionsEntrypoint( .querySelector("meta[name='manifest.open_in_tab']") ?.getAttribute('content'); if (openInTabContent) { - options.openInTab = Boolean(openInTabContent); + options.openInTab = openInTabContent === 'true'; } const chromeStyleContent = document .querySelector("meta[name='manifest.chrome_style']") ?.getAttribute('content'); if (chromeStyleContent) { - options.chromeStyle = Boolean(chromeStyleContent); + options.chromeStyle = chromeStyleContent === 'true'; } const browserStyleContent = document .querySelector("meta[name='manifest.browser_style']") ?.getAttribute('content'); if (browserStyleContent) { - options.browserStyle = Boolean(browserStyleContent); + options.browserStyle = browserStyleContent === 'true'; } return {