Skip to content
Open
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
37 changes: 37 additions & 0 deletions packages/wxt/src/core/utils/__tests__/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,43 @@ describe('Manifest Utils', () => {
expect(actual).toMatchObject(expected);
},
);

it('should merge user-defined sidebar_action with generated fields for firefox', async () => {
const sidepanel = fakeSidepanelEntrypoint({
outputDir: outDir,
skipped: false,
});
const buildOutput = fakeBuildOutput();

setFakeWxt({
config: {
manifestVersion: 3,
browser: 'firefox',
outDir,
manifest: {
sidebar_action: {
default_title: 'Custom Title',
default_icon: 'custom-icon.png',
custom_field: 'custom_value',
},
} as any,
},
});

const { manifest: actual } = await generateManifest(
[sidepanel],
buildOutput,
);

expect(actual.sidebar_action).toMatchObject({
default_panel: 'sidepanel.html',
default_title: 'Custom Title',
default_icon: 'custom-icon.png',
custom_field: 'custom_value',
browser_style: sidepanel.options.browserStyle,
open_at_install: sidepanel.options.openAtInstall,
});
});
});

describe('web_accessible_resources', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/wxt/src/core/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ function addEntrypoints(
default_icon: defaultSidepanel.options.defaultIcon,
default_title: defaultSidepanel.options.defaultTitle,
open_at_install: defaultSidepanel.options.openAtInstall,
...manifest.sidebar_action,
};
} else if (wxt.config.manifestVersion === 3) {
manifest.side_panel = {
Expand Down